@@ -585,26 +585,32 @@ fn update_camera(
585
585
info ! ( "Window resized - resizing all textures" ) ;
586
586
587
587
// TODO: Do we really want to resize these images every time?
588
+ let image_width = physical_view_width as f32 ; // / window.scale_factor() as f32;
589
+ let image_height = ( window. physical_height ( ) - top_panel_height as u32 ) as f32 ; // / window.scale_factor() as f32;
590
+
588
591
images
589
592
. get_mut ( & camera_setup. target . as_ref ( ) . unwrap ( ) )
590
593
. unwrap ( )
591
594
. resize ( Extent3d {
592
- width : physical_view_width ,
593
- height : window . physical_height ( ) - top_panel_height as u32 ,
595
+ width : image_width as u32 ,
596
+ height : image_height as u32 ,
594
597
..default ( )
595
598
} ) ;
596
599
images
597
600
. get_mut ( & camera_setup. cpu_target . as_ref ( ) . unwrap ( ) )
598
601
. unwrap ( )
599
602
. resize ( Extent3d {
600
- width : physical_view_width ,
601
- height : window . physical_height ( ) - top_panel_height as u32 ,
603
+ width : image_width as u32 ,
604
+ height : image_height as u32 ,
602
605
..default ( )
603
606
} ) ;
604
607
605
608
if let Ok ( mut view_texture_transform) = view_texture. get_single_mut ( ) {
606
- view_texture_transform. translation . x = -panel_width / 2.0 ;
607
- view_texture_transform. translation . y = top_panel_height / 2.0 ;
609
+ view_texture_transform. translation . x = -panel_width / 2.0 / window. scale_factor ( ) as f32 ;
610
+ view_texture_transform. translation . y = top_panel_height / 2.0 / window. scale_factor ( ) as f32 ;
611
+
612
+ view_texture_transform. scale . x = 1.0 / window. scale_factor ( ) as f32 ;
613
+ view_texture_transform. scale . y = 1.0 / window. scale_factor ( ) as f32 ;
608
614
}
609
615
610
616
// println!("{:?}", window);
0 commit comments