summaryrefslogtreecommitdiffstats
path: root/graphics/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-06-23 22:15:00 +0200
committerLibravatar GitHub <noreply@github.com>2022-06-23 22:15:00 +0200
commit0f6c62c14f5a2c898171f5729cdd0fb6d98ecd67 (patch)
tree4d10ad4f4a5be46ef87c9bcde4063ed35d9b3332 /graphics/src
parent092dfc34e8c0dacda9214e0cdbedda0c25e29cf3 (diff)
parenta983c0c15b8d92e24adbeda45879260de50687fc (diff)
downloadiced-0f6c62c14f5a2c898171f5729cdd0fb6d98ecd67.tar.gz
iced-0f6c62c14f5a2c898171f5729cdd0fb6d98ecd67.tar.bz2
iced-0f6c62c14f5a2c898171f5729cdd0fb6d98ecd67.zip
Merge pull request #1370 from jhannyjimenez/canvas_documentation_clarification
Added more clarification as to how the position and alignment of the …
Diffstat (limited to 'graphics/src')
-rw-r--r--graphics/src/widget/canvas/text.rs9
1 files changed, 8 insertions, 1 deletions
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,