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 7b8b01f560
commit 570600ce51
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
16 changed files with 79 additions and 78 deletions

View file

@ -32,7 +32,7 @@ pub trait Text {
const ARROW_DOWN_ICON: char;
/// Returns the default size of text.
fn default_size(&self) -> u16;
fn default_size(&self) -> f32;
/// Measures the text contents with the given size and font,
/// returning the size of a laid out paragraph that fits in the provided

View file

@ -130,14 +130,14 @@ where
const CHECKMARK_ICON: char = B::CHECKMARK_ICON;
const ARROW_DOWN_ICON: char = B::ARROW_DOWN_ICON;
fn default_size(&self) -> u16 {
fn default_size(&self) -> f32 {
self.backend().default_size()
}
fn measure(
&self,
content: &str,
size: u16,
size: f32,
font: Font,
bounds: Size,
) -> (f32, f32) {