summaryrefslogtreecommitdiffstats
path: root/graphics/src/primitive.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-08-30 04:31:21 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-08-30 04:31:21 +0200
commited3454301e663a7cb7d73cd56b57b188f4d14a2f (patch)
tree8118d1305c2eba3a1b45d04634cd0e8d050fc0fa /graphics/src/primitive.rs
parentc9bd48704dd9679c033dd0b8588e2744a3df44a0 (diff)
downloadiced-ed3454301e663a7cb7d73cd56b57b188f4d14a2f.tar.gz
iced-ed3454301e663a7cb7d73cd56b57b188f4d14a2f.tar.bz2
iced-ed3454301e663a7cb7d73cd56b57b188f4d14a2f.zip
Implement explicit text caching in the widget state tree
Diffstat (limited to 'graphics/src/primitive.rs')
-rw-r--r--graphics/src/primitive.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/graphics/src/primitive.rs b/graphics/src/primitive.rs
index 7592a410..cdc8923e 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`].
+ 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