From 36c03c8f86b1a623cfb43956f5b2b53954f17836 Mon Sep 17 00:00:00 2001 From: Johann Woelper Date: Thu, 29 Feb 2024 19:32:26 +0100 Subject: [PATCH] fix: Make sure window size is not larger than window --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1b26b18..9a97193 100644 --- a/src/main.rs +++ b/src/main.rs @@ -327,7 +327,6 @@ fn init(app: &mut App, gfx: &mut Graphics, plugins: &mut Plugins) -> OculanteSta style.text_styles.get_mut(&TextStyle::Button).unwrap().size = 18. * font_scale; style.text_styles.get_mut(&TextStyle::Small).unwrap().size = 15. * font_scale; style.text_styles.get_mut(&TextStyle::Heading).unwrap().size = 22. * font_scale; - debug!("Accent color: {:?}", state.persistent_settings.accent_color); style.visuals.selection.bg_fill = Color32::from_rgb( state.persistent_settings.accent_color[0], state.persistent_settings.accent_color[1], @@ -1101,7 +1100,10 @@ fn drawe(app: &mut App, gfx: &mut Graphics, plugins: &mut Plugins, state: &mut O if state.reset_image { let draw_area = ctx.available_rect(); - let window_size = nalgebra::Vector2::new(draw_area.width(), draw_area.height()); + let window_size = nalgebra::Vector2::new( + draw_area.width().min(app.window().width() as f32), + draw_area.height().min(app.window().height() as f32), + ); if let Some(current_image) = &state.current_image { let img_size = current_image.size_vec();