mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-09 12:28:29 +00:00
Move more logic into fj-viewer
This commit is contained in:
parent
bbdf3958c3
commit
394f5417b3
@ -84,7 +84,10 @@ impl Viewer {
|
||||
/// Handle the screen being resized
|
||||
pub fn on_screen_resize(&mut self, new_size: ScreenSize) {
|
||||
self.current_screen_size = new_size;
|
||||
self.renderer.handle_resize(new_size);
|
||||
if new_size.is_valid() {
|
||||
// We should only supply valid screen sizes to the renderer.
|
||||
self.renderer.handle_resize(new_size);
|
||||
}
|
||||
}
|
||||
|
||||
/// Compute and store a focus point, unless one is already stored
|
||||
|
@ -147,9 +147,7 @@ impl ApplicationHandler for DisplayState {
|
||||
// Only do a screen resize once per frame. This protects against
|
||||
// spurious resize events that cause issues with the renderer.
|
||||
if let Some(size) = self.new_size.take() {
|
||||
if !self.stop_drawing {
|
||||
viewer.on_screen_resize(size);
|
||||
}
|
||||
viewer.on_screen_resize(size);
|
||||
}
|
||||
|
||||
viewer.draw();
|
||||
|
Loading…
Reference in New Issue
Block a user