summaryrefslogtreecommitdiffstats
path: root/graphics/src/geometry/text.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2023-09-10 01:14:39 +0200
committerLibravatar GitHub <noreply@github.com>2023-09-10 01:14:39 +0200
commit1af5ff41abdef243588199ef7988666655924a02 (patch)
tree4dfd518dd93b0393e77355867062c60d75e7f358 /graphics/src/geometry/text.rs
parenta3489e4af960388e9f73988b88df361022a654a4 (diff)
parent1cc5bf59d7c4f47ae47d9a4e22ebaab3ea4975c1 (diff)
downloadiced-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/geometry/text.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/graphics/src/geometry/text.rs b/graphics/src/geometry/text.rs
index c584f3cd..0bf7ec97 100644
--- a/graphics/src/geometry/text.rs
+++ b/graphics/src/geometry/text.rs
@@ -1,6 +1,6 @@
use crate::core::alignment;
use crate::core::text::{LineHeight, Shaping};
-use crate::core::{Color, Font, Point};
+use crate::core::{Color, Font, Pixels, Point};
/// A bunch of text that can be drawn to a canvas
#[derive(Debug, Clone)]
@@ -19,7 +19,7 @@ pub struct Text {
/// The color of the text
pub color: Color,
/// The size of the text
- pub size: f32,
+ pub size: Pixels,
/// The line height of the text.
pub line_height: LineHeight,
/// The font of the text
@@ -38,7 +38,7 @@ impl Default for Text {
content: String::new(),
position: Point::ORIGIN,
color: Color::BLACK,
- size: 16.0,
+ size: Pixels(16.0),
line_height: LineHeight::Relative(1.2),
font: Font::default(),
horizontal_alignment: alignment::Horizontal::Left,