[egui_glium] Fix set_window_size for non-native pixels_per_point
This commit is contained in:
parent
1f2aebc25a
commit
718eec4b89
2 changed files with 8 additions and 7 deletions
|
@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
### Fixed 🐛
|
||||
|
||||
* Fix a bug where key releases weren't sent to Egui
|
||||
* Fix `set_window_size` for non-native `pixels_per_point`.
|
||||
|
||||
|
||||
## 0.7.0 - 2021-01-04
|
||||
|
|
|
@ -237,13 +237,13 @@ pub fn run(mut app: Box<dyn epi::App>) -> ! {
|
|||
}
|
||||
|
||||
if let Some(window_size) = window_size {
|
||||
display
|
||||
.gl_window()
|
||||
.window()
|
||||
.set_inner_size(glutin::dpi::LogicalSize {
|
||||
width: window_size.x,
|
||||
height: window_size.y,
|
||||
});
|
||||
display.gl_window().window().set_inner_size(
|
||||
glutin::dpi::PhysicalSize {
|
||||
width: (ctx.pixels_per_point() * window_size.x).round(),
|
||||
height: (ctx.pixels_per_point() * window_size.y).round(),
|
||||
}
|
||||
.to_logical::<f32>(native_pixels_per_point(&display) as f64),
|
||||
);
|
||||
}
|
||||
|
||||
*control_flow = if quit {
|
||||
|
|
Loading…
Reference in a new issue