File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,12 @@ impl RenderState {
188188 pub ( crate ) fn resize ( & mut self , width : u32 , height : u32 ) {
189189 self . desired_width = width;
190190 self . desired_height = height;
191+
192+ if width > 0 && height > 0 && ( self . config . width != width || self . config . height != height) {
193+ self . config . width = width;
194+ self . config . height = height;
195+ self . surface . configure ( & self . context . device , & self . config ) ;
196+ }
191197 }
192198
193199 pub ( crate ) fn bind_viewport_texture ( & mut self , viewport_texture : wgpu:: Texture ) {
@@ -201,17 +207,8 @@ impl RenderState {
201207 }
202208
203209 pub ( crate ) fn bind_ui_texture ( & mut self , bind_ui_texture : wgpu:: Texture ) {
204- let width = bind_ui_texture. width ( ) ;
205- let height = bind_ui_texture. height ( ) ;
206-
207210 self . ui_texture = Some ( bind_ui_texture) ;
208211 self . update_bindgroup ( ) ;
209-
210- if width > 0 && height > 0 && ( self . config . width != width || self . config . height != height) {
211- self . config . width = width;
212- self . config . height = height;
213- self . surface . configure ( & self . context . device , & self . config ) ;
214- }
215212 }
216213
217214 pub ( crate ) fn set_viewport_scale ( & mut self , scale : [ f32 ; 2 ] ) {
You can’t perform that action at this time.
0 commit comments