summaryrefslogtreecommitdiff
path: root/src/library/text.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-01-05 16:01:56 +0100
committerLaurenz <laurmaedje@gmail.com>2022-01-05 23:55:06 +0100
commit5fd9c0b0d7b519802d56dd04cb61340c11014cb1 (patch)
treea791ad72a92037426c1b170ccc543fb1afff0c77 /src/library/text.rs
parentf7e8624b4cf31744d600167dd7f3a9d9d1626014 (diff)
Lift styles out of individual nodes
Diffstat (limited to 'src/library/text.rs')
-rw-r--r--src/library/text.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/library/text.rs b/src/library/text.rs
index 486cb77f..ab5c15c3 100644
--- a/src/library/text.rs
+++ b/src/library/text.rs
@@ -18,12 +18,7 @@ use crate::util::{EcoString, SliceExt};
/// A single run of text with the same style.
#[derive(Hash)]
-pub struct TextNode {
- /// The run's text.
- pub text: EcoString,
- /// The run's styles.
- pub styles: StyleMap,
-}
+pub struct TextNode(pub EcoString);
#[properties]
impl TextNode {
@@ -154,10 +149,7 @@ impl Set for TextNode {
impl Debug for TextNode {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
- if f.alternate() {
- self.styles.fmt(f)?;
- }
- write!(f, "Text({:?})", self.text)
+ write!(f, "Text({:?})", self.0)
}
}