diff options
author | 2020-05-27 23:09:27 +0200 | |
---|---|---|
committer | 2020-05-27 23:09:27 +0200 | |
commit | 823ea1573245b849a0696543838a7ad1d0f914d8 (patch) | |
tree | 209b1697e46399210daa573d0479986b01d6053d /graphics | |
parent | 22ced3485eb6f295faaab1e31d8d1b8d61fc422b (diff) | |
download | iced-823ea1573245b849a0696543838a7ad1d0f914d8.tar.gz iced-823ea1573245b849a0696543838a7ad1d0f914d8.tar.bz2 iced-823ea1573245b849a0696543838a7ad1d0f914d8.zip |
Update `glyph_brush` and `glow_glyph`
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 } |