diff options
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/src/backend.rs | 2 | ||||
-rw-r--r-- | graphics/src/widget/text_input.rs | 9 |
2 files changed, 1 insertions, 10 deletions
diff --git a/graphics/src/backend.rs b/graphics/src/backend.rs index 3fcb42f7..ee4eca0a 100644 --- a/graphics/src/backend.rs +++ b/graphics/src/backend.rs @@ -17,8 +17,6 @@ pub trait Text { font: Font, bounds: Size, ) -> (f32, f32); - - fn space_width(&self, size: f32) -> f32; } pub trait Image { diff --git a/graphics/src/widget/text_input.rs b/graphics/src/widget/text_input.rs index 023bdd7f..893197d1 100644 --- a/graphics/src/widget/text_input.rs +++ b/graphics/src/widget/text_input.rs @@ -37,16 +37,9 @@ where fn measure_value(&self, value: &str, size: u16, font: Font) -> f32 { let backend = self.backend(); - let (mut width, _) = + let (width, _) = backend.measure(value, f32::from(size), font, Size::INFINITY); - let spaces_around = value.len() - value.trim().len(); - - if spaces_around > 0 { - let space_width = backend.space_width(size as f32); - width += spaces_around as f32 * space_width; - } - width } |