Implement explicit text caching in the widget state tree
This commit is contained in:
parent
c9bd48704d
commit
ed3454301e
79 changed files with 1910 additions and 1705 deletions
|
|
@ -3,7 +3,8 @@ use crate::core::alignment;
|
|||
use crate::core::image;
|
||||
use crate::core::svg;
|
||||
use crate::core::text;
|
||||
use crate::core::{Background, Color, Font, Rectangle, Vector};
|
||||
use crate::core::{Background, Color, Font, Pixels, Point, Rectangle, Vector};
|
||||
use crate::text::paragraph;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
|
|
@ -19,7 +20,7 @@ pub enum Primitive<T> {
|
|||
/// The color of the text
|
||||
color: Color,
|
||||
/// The size of the text in logical pixels
|
||||
size: f32,
|
||||
size: Pixels,
|
||||
/// The line height of the text
|
||||
line_height: text::LineHeight,
|
||||
/// The font of the text
|
||||
|
|
@ -31,6 +32,15 @@ pub enum Primitive<T> {
|
|||
/// The shaping strategy of the text.
|
||||
shaping: text::Shaping,
|
||||
},
|
||||
/// A paragraph primitive
|
||||
Paragraph {
|
||||
/// The [`Paragraph`].
|
||||
paragraph: paragraph::Weak,
|
||||
/// The position of the [`Paragraph`].
|
||||
position: Point,
|
||||
/// The color of the [`Paragraph`].
|
||||
color: Color,
|
||||
},
|
||||
/// A quad primitive
|
||||
Quad {
|
||||
/// The bounds of the quad
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue