mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Make the Text tool control bar font family, style, and size sync with the selected layer (#4118)
* Fix contenteditable preview alignment * Make the Text tool control bar font family, style, and size sync with the selected layer * Tidying up
This commit is contained in:
@@ -71,6 +71,19 @@ impl TextAlign {
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// CSS `(text-align, text-align-last)` values approximating this alignment for the `contenteditable` text overlay.
|
||||
pub fn css(self) -> (&'static str, &'static str) {
|
||||
match self {
|
||||
Self::AlignLeft => ("left", "auto"),
|
||||
Self::AlignCenter => ("center", "auto"),
|
||||
Self::AlignRight => ("right", "auto"),
|
||||
Self::JustifyLeft => ("justify", "auto"),
|
||||
Self::JustifyCenter => ("justify", "center"),
|
||||
Self::JustifyRight => ("justify", "right"),
|
||||
Self::JustifyAll => ("justify", "justify"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Clone, Copy, Debug)]
|
||||
|
||||
Reference in New Issue
Block a user