Set text fill color to the primary color (#521)

* Fix text has no fill

* Use primary color for text fill

* Use correct text color when editing

* Change fallback text color to gray
This commit is contained in:
Paul Kupper
2022-02-07 20:58:22 +01:00
committed by Keavon Chambers
parent 5ea4654f53
commit cb9a37b638
3 changed files with 7 additions and 3 deletions
+5 -1
View File
@@ -43,13 +43,17 @@ impl LayerData for Text {
if self.editable {
let _ = write!(
svg,
r#"<foreignObject transform="matrix({})"></foreignObject>"#,
r#"<foreignObject transform="matrix({})" style="color: {}"></foreignObject>"#,
transform
.to_cols_array()
.iter()
.enumerate()
.map(|(i, entry)| { entry.to_string() + if i == 5 { "" } else { "," } })
.collect::<String>(),
match self.style.fill() {
Some(fill) => format!("#{}", fill.color().rgba_hex()),
None => "gray".to_string(),
}
);
} else {
let mut path = self.to_bez_path();