diff options
author | 2023-09-10 01:14:39 +0200 | |
---|---|---|
committer | 2023-09-10 01:14:39 +0200 | |
commit | 1af5ff41abdef243588199ef7988666655924a02 (patch) | |
tree | 4dfd518dd93b0393e77355867062c60d75e7f358 /graphics/src/primitive.rs | |
parent | a3489e4af960388e9f73988b88df361022a654a4 (diff) | |
parent | 1cc5bf59d7c4f47ae47d9a4e22ebaab3ea4975c1 (diff) | |
download | iced-1af5ff41abdef243588199ef7988666655924a02.tar.gz iced-1af5ff41abdef243588199ef7988666655924a02.tar.bz2 iced-1af5ff41abdef243588199ef7988666655924a02.zip |
Merge pull request #2058 from iced-rs/explicit-text-caching
Explicit text caching
Diffstat (limited to '')
-rw-r--r-- | graphics/src/primitive.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/graphics/src/primitive.rs b/graphics/src/primitive.rs index 7592a410..8a97e6e7 100644 --- a/graphics/src/primitive.rs +++ b/graphics/src/primitive.rs @@ -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::Weak`] reference. + 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 |