Remember to update glow window size when DPI changes (#1441)
This commit is contained in:
parent
aa6a2bb73f
commit
95efbbc03e
4 changed files with 18 additions and 4 deletions
|
@ -19,6 +19,7 @@ NOTE: [`egui_web`](../egui_web/CHANGELOG.md), [`egui-winit`](../egui-winit/CHANG
|
|||
* Changed `App::update` to take `&mut Frame` instead of `&Frame`.
|
||||
* `Frame` is no longer `Clone` or `Sync`.
|
||||
* Add `glow` (OpenGL) context to `Frame` ([#1425](https://github.com/emilk/egui/pull/1425)).
|
||||
* Fixed potential scale bug when DPI scaling changes (e.g. when dragging a window between different displays) ([#1441](https://github.com/emilk/egui/pull/1441)).
|
||||
|
||||
|
||||
## 0.17.0 - 2022-02-22
|
||||
|
|
|
@ -5,6 +5,7 @@ All notable changes to the `egui_glow` integration will be noted in this file.
|
|||
## Unreleased
|
||||
* Improved logging on rendering failures.
|
||||
* Add new `NativeOptions`: `vsync`, `multisampling`, `depth_buffer`, `stencil_buffer`.
|
||||
* Fixed potential scale bug when DPI scaling changes (e.g. when dragging a window between different displays) ([#1441](https://github.com/emilk/egui/pull/1441)).
|
||||
|
||||
|
||||
## 0.17.0 - 2022-02-22
|
||||
|
|
|
@ -65,8 +65,14 @@ fn main() {
|
|||
*control_flow = glutin::event_loop::ControlFlow::Exit;
|
||||
}
|
||||
|
||||
if let glutin::event::WindowEvent::Resized(physical_size) = event {
|
||||
gl_window.resize(physical_size);
|
||||
if let glutin::event::WindowEvent::Resized(physical_size) = &event {
|
||||
gl_window.resize(*physical_size);
|
||||
} else if let glutin::event::WindowEvent::ScaleFactorChanged {
|
||||
new_inner_size,
|
||||
..
|
||||
} = &event
|
||||
{
|
||||
gl_window.resize(**new_inner_size);
|
||||
}
|
||||
|
||||
egui_glow.on_event(&event);
|
||||
|
|
|
@ -136,8 +136,14 @@ pub fn run(app_name: &str, native_options: &epi::NativeOptions, app_creator: epi
|
|||
is_focused = new_focused;
|
||||
}
|
||||
|
||||
if let winit::event::WindowEvent::Resized(physical_size) = event {
|
||||
gl_window.resize(physical_size);
|
||||
if let winit::event::WindowEvent::Resized(physical_size) = &event {
|
||||
gl_window.resize(*physical_size);
|
||||
} else if let glutin::event::WindowEvent::ScaleFactorChanged {
|
||||
new_inner_size,
|
||||
..
|
||||
} = &event
|
||||
{
|
||||
gl_window.resize(**new_inner_size);
|
||||
}
|
||||
|
||||
integration.on_event(app.as_mut(), &event);
|
||||
|
|
Loading…
Reference in a new issue