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 11:58:22 -08:00
committed by Keavon Chambers
parent 6d695a0a25
commit 5534d0a44c
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();