diff options
author | 2020-05-27 23:09:27 +0200 | |
---|---|---|
committer | 2020-05-27 23:09:27 +0200 | |
commit | 823ea1573245b849a0696543838a7ad1d0f914d8 (patch) | |
tree | 209b1697e46399210daa573d0479986b01d6053d /glow/src/backend.rs | |
parent | 22ced3485eb6f295faaab1e31d8d1b8d61fc422b (diff) | |
download | iced-823ea1573245b849a0696543838a7ad1d0f914d8.tar.gz iced-823ea1573245b849a0696543838a7ad1d0f914d8.tar.bz2 iced-823ea1573245b849a0696543838a7ad1d0f914d8.zip |
Update `glyph_brush` and `glow_glyph`
Diffstat (limited to 'glow/src/backend.rs')
-rw-r--r-- | glow/src/backend.rs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/glow/src/backend.rs b/glow/src/backend.rs index c98aa5fe..6bd443ad 100644 --- a/glow/src/backend.rs +++ b/glow/src/backend.rs @@ -101,7 +101,6 @@ impl Backend { for text in layer.text.iter() { // Target physical coordinates directly to avoid blurry text let text = glow_glyph::Section { - text: text.content, // TODO: We `round` here to avoid rerasterizing text when // its position changes slightly. This can make text feel a // bit "jumpy". We may be able to do better once we improve @@ -123,12 +122,18 @@ impl Backend { (text.bounds.width * scale_factor).ceil(), (text.bounds.height * scale_factor).ceil(), ), - scale: glow_glyph::Scale { - x: text.size * scale_factor, - y: text.size * scale_factor, - }, - color: text.color, - font_id: self.text_pipeline.find_font(text.font), + text: vec![glow_glyph::Text { + text: text.content, + scale: glow_glyph::ab_glyph::PxScale { + x: text.size * scale_factor, + y: text.size * scale_factor, + }, + font_id: self.text_pipeline.find_font(text.font), + extra: glow_glyph::Extra { + color: text.color, + z: 0.0, + }, + }], layout: glow_glyph::Layout::default() .h_align(match text.horizontal_alignment { HorizontalAlignment::Left => { @@ -191,10 +196,6 @@ impl backend::Text for Backend { ) -> (f32, f32) { self.text_pipeline.measure(contents, size, font, bounds) } - - fn space_width(&self, size: f32) -> f32 { - self.text_pipeline.space_width(size) - } } #[cfg(feature = "image")] |