diff options
Diffstat (limited to '')
| -rw-r--r-- | wgpu/src/backend.rs | 4 | ||||
| -rw-r--r-- | wgpu/src/text.rs | 16 | 
2 files changed, 0 insertions, 20 deletions
| diff --git a/wgpu/src/backend.rs b/wgpu/src/backend.rs index 1e62cf07..04eb0b28 100644 --- a/wgpu/src/backend.rs +++ b/wgpu/src/backend.rs @@ -250,10 +250,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")] diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index 17d3f6dd..d65c0385 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -6,7 +6,6 @@ use std::{cell::RefCell, collections::HashMap};  pub struct Pipeline {      draw_brush: RefCell<wgpu_glyph::GlyphBrush<'static, ()>>,      draw_font_map: RefCell<HashMap<String, wgpu_glyph::FontId>>, -      measure_brush: RefCell<glyph_brush::GlyphBrush<'static, ()>>,  } @@ -52,7 +51,6 @@ impl Pipeline {          Pipeline {              draw_brush: RefCell::new(draw_brush),              draw_font_map: RefCell::new(HashMap::new()), -              measure_brush: RefCell::new(measure_brush),          }      } @@ -109,20 +107,6 @@ impl Pipeline {          }      } -    pub fn space_width(&self, size: f32) -> f32 { -        use wgpu_glyph::GlyphCruncher; - -        let glyph_brush = self.measure_brush.borrow(); - -        // TODO: Select appropriate font -        let font = &glyph_brush.fonts()[0]; - -        font.glyph(' ') -            .scaled(wgpu_glyph::Scale { x: size, y: size }) -            .h_metrics() -            .advance_width -    } -      pub fn trim_measurement_cache(&mut self) {          // TODO: We should probably use a `GlyphCalculator` for this. However,          // it uses a lifetimed `GlyphCalculatorGuard` with side-effects on drop. | 
