Fix overlay::Menu line height
This commit is contained in:
parent
a2ab9e9395
commit
eb3cd3a321
1 changed files with 5 additions and 5 deletions
|
|
@ -344,7 +344,7 @@ where
|
||||||
let size = {
|
let size = {
|
||||||
let intrinsic = Size::new(
|
let intrinsic = Size::new(
|
||||||
0.0,
|
0.0,
|
||||||
(text_size + self.padding.vertical())
|
(text_size * 1.2 + self.padding.vertical())
|
||||||
* self.options.len() as f32,
|
* self.options.len() as f32,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -386,7 +386,7 @@ where
|
||||||
|
|
||||||
*self.hovered_option = Some(
|
*self.hovered_option = Some(
|
||||||
((cursor_position.y - bounds.y)
|
((cursor_position.y - bounds.y)
|
||||||
/ (text_size + self.padding.vertical()))
|
/ (text_size * 1.2 + self.padding.vertical()))
|
||||||
as usize,
|
as usize,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -401,7 +401,7 @@ where
|
||||||
|
|
||||||
*self.hovered_option = Some(
|
*self.hovered_option = Some(
|
||||||
((cursor_position.y - bounds.y)
|
((cursor_position.y - bounds.y)
|
||||||
/ (text_size + self.padding.vertical()))
|
/ (text_size * 1.2 + self.padding.vertical()))
|
||||||
as usize,
|
as usize,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -451,7 +451,7 @@ where
|
||||||
let text_size =
|
let text_size =
|
||||||
self.text_size.unwrap_or_else(|| renderer.default_size());
|
self.text_size.unwrap_or_else(|| renderer.default_size());
|
||||||
let option_height =
|
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 offset = viewport.y - bounds.y;
|
||||||
let start = (offset / option_height as f32) as usize;
|
let start = (offset / option_height as f32) as usize;
|
||||||
|
|
@ -468,7 +468,7 @@ where
|
||||||
x: bounds.x,
|
x: bounds.x,
|
||||||
y: bounds.y + (option_height * i) as f32,
|
y: bounds.y + (option_height * i) as f32,
|
||||||
width: bounds.width,
|
width: bounds.width,
|
||||||
height: text_size + self.padding.vertical(),
|
height: text_size * 1.2 + self.padding.vertical(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if is_selected {
|
if is_selected {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue