diff options
Diffstat (limited to 'native/src/overlay/menu.rs')
-rw-r--r-- | native/src/overlay/menu.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/native/src/overlay/menu.rs b/native/src/overlay/menu.rs index fac3028e..efee14d4 100644 --- a/native/src/overlay/menu.rs +++ b/native/src/overlay/menu.rs @@ -344,9 +344,7 @@ where let size = { let intrinsic = Size::new( 0.0, - text_size - + f32::from(self.padding.vertical()) - * self.options.len() as f32, + text_size + self.padding.vertical() * self.options.len() as f32, ); limits.resolve(intrinsic) @@ -387,7 +385,7 @@ where *self.hovered_option = Some( ((cursor_position.y - bounds.y) - / (text_size + f32::from(self.padding.vertical()))) + / (text_size + self.padding.vertical())) as usize, ); } @@ -402,7 +400,7 @@ where *self.hovered_option = Some( ((cursor_position.y - bounds.y) - / (text_size + f32::from(self.padding.vertical()))) + / (text_size + self.padding.vertical())) as usize, ); @@ -451,8 +449,7 @@ where let text_size = self.text_size.unwrap_or_else(|| renderer.default_size()); - let option_height = - (text_size + f32::from(self.padding.vertical())) as usize; + let option_height = (text_size + self.padding.vertical()) as usize; let offset = viewport.y - bounds.y; let start = (offset / option_height as f32) as usize; @@ -469,7 +466,7 @@ where x: bounds.x, y: bounds.y + (option_height * i) as f32, width: bounds.width, - height: text_size + f32::from(self.padding.vertical()), + height: text_size + self.padding.vertical(), }; if is_selected { @@ -487,12 +484,12 @@ where renderer.fill_text(Text { content: &option.to_string(), bounds: Rectangle { - x: bounds.x + self.padding.left as f32, + x: bounds.x + self.padding.left, y: bounds.center_y(), width: f32::INFINITY, ..bounds }, - size: f32::from(text_size), + size: text_size, font: self.font.clone(), color: if is_selected { appearance.selected_text_color |