1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

egui-winit: don't repaint when just moving window (#1980)

* Bug fix: reset repaint countdown when we pass it

* eframe: debug-print what winit event caused a repaint

* egui-winit: don't repaint when only moving window

* fix docstring
This commit is contained in:
Emil Ernerfeldt
2022-08-29 11:20:19 +02:00
committed by GitHub
parent 9b2c3d1026
commit ac4d75e9b4
8 changed files with 139 additions and 62 deletions

View File

@@ -1,7 +1,9 @@
use crate::{epi, Theme, WindowInfo};
use egui_winit::{native_pixels_per_point, WindowSettings};
use winit::event_loop::EventLoopWindowTarget;
use egui_winit::{native_pixels_per_point, EventResponse, WindowSettings};
use crate::{epi, Theme, WindowInfo};
pub fn points_to_size(points: egui::Vec2) -> winit::dpi::LogicalSize<f64> {
winit::dpi::LogicalSize {
width: points.x as f64,
@@ -248,7 +250,11 @@ impl EpiIntegration {
self.close
}
pub fn on_event(&mut self, app: &mut dyn epi::App, event: &winit::event::WindowEvent<'_>) {
pub fn on_event(
&mut self,
app: &mut dyn epi::App,
event: &winit::event::WindowEvent<'_>,
) -> EventResponse {
use winit::event::{ElementState, MouseButton, WindowEvent};
match event {
@@ -262,7 +268,7 @@ impl EpiIntegration {
_ => {}
}
self.egui_winit.on_event(&self.egui_ctx, event);
self.egui_winit.on_event(&self.egui_ctx, event)
}
pub fn update(