Use Pixels for Text::size

This commit is contained in:
Héctor Ramón Jiménez 2023-02-04 16:41:18 +01:00
parent de7fc637cf
commit a2ab9e9395
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
7 changed files with 19 additions and 25 deletions

View file

@ -450,7 +450,8 @@ where
let text_size =
self.text_size.unwrap_or_else(|| renderer.default_size());
let option_height = (text_size + self.padding.vertical()) as usize;
let option_height =
(text_size + f32::from(self.padding.vertical())) as usize;
let offset = viewport.y - bounds.y;
let start = (offset / option_height as f32) as usize;