diff options
author | 2024-01-19 20:41:52 +0100 | |
---|---|---|
committer | 2024-01-19 20:41:52 +0100 | |
commit | 1781068e1c3a65551db1e832fdbaddba99124051 (patch) | |
tree | 60e0b3854cc0541712572fbb0e56f14435951ea9 /graphics/src/primitive.rs | |
parent | 41dec5bd203ff5b1574a33a17d5f7358ae1beea2 (diff) | |
parent | 7ae7fcb89855002519bab752fd3686106ce448db (diff) | |
download | iced-1781068e1c3a65551db1e832fdbaddba99124051.tar.gz iced-1781068e1c3a65551db1e832fdbaddba99124051.tar.bz2 iced-1781068e1c3a65551db1e832fdbaddba99124051.zip |
Merge branch 'master' into remove-vertex-indexing
Diffstat (limited to 'graphics/src/primitive.rs')
-rw-r--r-- | graphics/src/primitive.rs | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/graphics/src/primitive.rs b/graphics/src/primitive.rs index 8a97e6e7..20affaaf 100644 --- a/graphics/src/primitive.rs +++ b/graphics/src/primitive.rs @@ -4,6 +4,7 @@ use crate::core::image; use crate::core::svg; use crate::core::text; use crate::core::{Background, Color, Font, Pixels, Point, Rectangle, Vector}; +use crate::text::editor; use crate::text::paragraph; use std::sync::Arc; @@ -13,24 +14,26 @@ use std::sync::Arc; pub enum Primitive<T> { /// A text primitive Text { - /// The contents of the text + /// The contents of the text. content: String, - /// The bounds of the text + /// The bounds of the text. bounds: Rectangle, - /// The color of the text + /// The color of the text. color: Color, - /// The size of the text in logical pixels + /// The size of the text in logical pixels. size: Pixels, - /// The line height of the text + /// The line height of the text. line_height: text::LineHeight, - /// The font of the text + /// The font of the text. font: Font, - /// The horizontal alignment of the text + /// The horizontal alignment of the text. horizontal_alignment: alignment::Horizontal, - /// The vertical alignment of the text + /// The vertical alignment of the text. vertical_alignment: alignment::Vertical, /// The shaping strategy of the text. shaping: text::Shaping, + /// The clip bounds of the text. + clip_bounds: Rectangle, }, /// A paragraph primitive Paragraph { @@ -40,7 +43,22 @@ pub enum Primitive<T> { position: Point, /// The color of the paragraph. color: Color, + /// The clip bounds of the paragraph. + clip_bounds: Rectangle, }, + /// An editor primitive + Editor { + /// The [`editor::Weak`] reference. + editor: editor::Weak, + /// The position of the editor. + position: Point, + /// The color of the editor. + color: Color, + /// The clip bounds of the editor. + clip_bounds: Rectangle, + }, + /// A raw `cosmic-text` primitive + RawText(crate::text::Raw), /// A quad primitive Quad { /// The bounds of the quad @@ -58,6 +76,8 @@ pub enum Primitive<T> { Image { /// The handle of the image handle: image::Handle, + /// The filter method of the image + filter_method: image::FilterMethod, /// The bounds of the image bounds: Rectangle, }, |