Call resize on window move, to handle moving across displays with differing resolutions and scale factors.
@@ -136,6 +136,12 @@ pub fn main_loop<GS: GameState>(mut bterm: BTerm, mut gamestate: GS) -> Result<(
bterm.on_event(BEvent::Moved {
new_position: Point::new(physical_position.x, physical_position.y),
});
+
+ let scale_factor = wc.window().scale_factor();
+ let physical_size = wc.window().inner_size();
+ wc.resize(physical_size);
+ on_resize(&mut bterm, physical_size, scale_factor, true)
+ .unwrap();
}
WindowEvent::Resized(_physical_size) => {
let scale_factor = wc.window().scale_factor();
