Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remember to update glow window size when DPI changes #1441

Merged
merged 3 commits into from
Apr 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eframe/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions egui_glow/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions egui_glow/examples/pure_glow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 8 additions & 2 deletions egui_glow/src/epi_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down