Fix overlay::Menu line height

This commit is contained in:
Héctor Ramón Jiménez 2023-02-05 18:24:58 +01:00
parent a2ab9e9395
commit eb3cd3a321
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -344,7 +344,7 @@ where
let size = {
let intrinsic = Size::new(
0.0,
(text_size + self.padding.vertical())
(text_size * 1.2 + self.padding.vertical())
* self.options.len() as f32,
);
@ -386,7 +386,7 @@ where
*self.hovered_option = Some(
((cursor_position.y - bounds.y)
/ (text_size + self.padding.vertical()))
/ (text_size * 1.2 + self.padding.vertical()))
as usize,
);
}
@ -401,7 +401,7 @@ where
*self.hovered_option = Some(
((cursor_position.y - bounds.y)
/ (text_size + self.padding.vertical()))
/ (text_size * 1.2 + self.padding.vertical()))
as usize,
);
@ -451,7 +451,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;
(text_size * 1.2 + f32::from(self.padding.vertical())) as usize;
let offset = viewport.y - bounds.y;
let start = (offset / option_height as f32) as usize;
@ -468,7 +468,7 @@ where
x: bounds.x,
y: bounds.y + (option_height * i) as f32,
width: bounds.width,
height: text_size + self.padding.vertical(),
height: text_size * 1.2 + self.padding.vertical(),
};
if is_selected {