From 8da22c5de4eac55dd24b859fc1397054531e8999 Mon Sep 17 00:00:00 2001 From: Cyrix126 Date: Fri, 1 Nov 2024 12:58:50 +0100 Subject: [PATCH] fix: egui crash in debug --- src/app/panels/middle/status/processes.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/panels/middle/status/processes.rs b/src/app/panels/middle/status/processes.rs index fd3be76..da48595 100644 --- a/src/app/panels/middle/status/processes.rs +++ b/src/app/panels/middle/status/processes.rs @@ -36,11 +36,11 @@ impl Status { max_threads: usize, ) { // set fixed text size, temporary solution before refactoring text/widget size. - let width = (size.x / 5.0) - (SPACE * 1.7500); + let width = ((size.x / 5.0) - (SPACE * 1.7500)).max(0.0); let height = size.y / 25.0; // height must be height - top - bottom - space * 2 - space of text let size: Vec2 = [width, height].into(); - let min_height = size.y - SPACE; + let min_height = (size.y - SPACE).max(0.0); // min width must allow to display text without wrapping. let size_text = ui.text_style_height(&TextStyle::Body); // ui.spacing_mut().item_spacing = Vec2::new(2.0, 2.0);