Move text logic in iced_wgpu to a text module
This commit is contained in:
parent
73f3c90007
commit
f0b1e65ba4
6 changed files with 131 additions and 82 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use crate::{Primitive, Renderer};
|
||||
use iced_native::{layout, text, Color, Layout, MouseCursor, Size, Text};
|
||||
|
||||
use wgpu_glyph::{GlyphCruncher, Section};
|
||||
use wgpu_glyph::Section;
|
||||
|
||||
use std::f32;
|
||||
|
||||
|
|
@ -21,13 +21,7 @@ impl text::Renderer for Renderer {
|
|||
..Default::default()
|
||||
};
|
||||
|
||||
let (width, height) = if let Some(bounds) =
|
||||
self.text_measurements.borrow_mut().glyph_bounds(§ion)
|
||||
{
|
||||
(bounds.width().ceil(), bounds.height().ceil())
|
||||
} else {
|
||||
(0.0, 0.0)
|
||||
};
|
||||
let (width, height) = self.text_pipeline.measure(§ion);
|
||||
|
||||
let size = limits.resolve(Size::new(width, height));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue