diff options
| author | 2022-07-08 19:31:45 +0200 | |
|---|---|---|
| committer | 2022-07-08 19:31:45 +0200 | |
| commit | fa55dff61db47197a961152285c6a6abfab0b217 (patch) | |
| tree | 44904afb16a0cab9e22fce0d73a5616676cd426b /graphics | |
| parent | 1dd1a2f97fc747e15e12b5188dad6c41b0d052ea (diff) | |
| parent | 66eb6263003c1bbedd1fd14d6b12f172d20a6211 (diff) | |
| download | iced-fa55dff61db47197a961152285c6a6abfab0b217.tar.gz iced-fa55dff61db47197a961152285c6a6abfab0b217.tar.bz2 iced-fa55dff61db47197a961152285c6a6abfab0b217.zip | |
Merge branch 'master' into theming
Diffstat (limited to '')
| -rw-r--r-- | graphics/Cargo.toml | 2 | ||||
| -rw-r--r-- | graphics/src/widget/canvas/text.rs | 9 | ||||
| -rw-r--r-- | graphics/src/widget/pure/canvas.rs | 3 | 
3 files changed, 11 insertions, 3 deletions
| diff --git a/graphics/Cargo.toml b/graphics/Cargo.toml index e916975d..a27c5d7c 100644 --- a/graphics/Cargo.toml +++ b/graphics/Cargo.toml @@ -1,6 +1,6 @@  [package]  name = "iced_graphics" -version = "0.3.0" +version = "0.3.1"  authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]  edition = "2021"  description = "A bunch of backend-agnostic types that can be leveraged to build a renderer for Iced" diff --git a/graphics/src/widget/canvas/text.rs b/graphics/src/widget/canvas/text.rs index ab070a70..056f8204 100644 --- a/graphics/src/widget/canvas/text.rs +++ b/graphics/src/widget/canvas/text.rs @@ -6,7 +6,14 @@ use crate::{Color, Font, Point};  pub struct Text {      /// The contents of the text      pub content: String, -    /// The position where to begin drawing the text (top-left corner coordinates) +    /// The position of the text relative to the alignment properties. +    /// By default, this position will be relative to the top-left corner coordinate meaning that +    /// if the horizontal and vertical alignments are unchanged, this property will tell where the +    /// top-left corner of the text should be placed. +    /// By changing the horizontal_alignment and vertical_alignment properties, you are are able to +    /// change what part of text is placed at this positions. +    /// For example, when the horizontal_alignment and vertical_alignment are set to Center, the +    /// center of the text will be placed at the given position NOT the top-left coordinate.      pub position: Point,      /// The color of the text      pub color: Color, diff --git a/graphics/src/widget/pure/canvas.rs b/graphics/src/widget/pure/canvas.rs index d9c7e66b..0eeff3d1 100644 --- a/graphics/src/widget/pure/canvas.rs +++ b/graphics/src/widget/pure/canvas.rs @@ -111,7 +111,8 @@ where      B: Backend,  {      fn tag(&self) -> tree::Tag { -        tree::Tag::of::<P::State>() +        struct Tag<T>(T); +        tree::Tag::of::<Tag<P::State>>()      }      fn state(&self) -> tree::State { | 
