mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 11:28:12 +08:00
Can set stroke and fill on text and shapes (#551)
* Can set stroke and fill on text and shapes * resend layout on failed update * text input properly resets on bad input * support modifying gradients * can modify gradients in the properties panel * updated labels * remove heap allocation in favor of RC * removed redundent line * oops
This commit is contained in:
@@ -775,11 +775,18 @@ impl Document {
|
||||
let layer = self.layer_mut(&path)?;
|
||||
match &mut layer.data {
|
||||
LayerDataType::Shape(s) => s.style = style,
|
||||
LayerDataType::Text(text) => text.style = style,
|
||||
_ => return Err(DocumentError::NotAShape),
|
||||
}
|
||||
self.mark_as_dirty(&path)?;
|
||||
Some([vec![DocumentChanged, LayerChanged { path: path.clone() }], update_thumbnails_upstream(&path)].concat())
|
||||
}
|
||||
Operation::SetLayerStroke { path, stroke } => {
|
||||
let layer = self.layer_mut(&path)?;
|
||||
layer.style_mut()?.set_stroke(stroke);
|
||||
self.mark_as_dirty(&path)?;
|
||||
Some([vec![DocumentChanged], update_thumbnails_upstream(&path)].concat())
|
||||
}
|
||||
Operation::SetLayerFill { path, fill } => {
|
||||
let layer = self.layer_mut(&path)?;
|
||||
layer.style_mut()?.set_fill(fill);
|
||||
|
||||
Reference in New Issue
Block a user