mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 03:28:11 +08:00
Add Pen Tool (#536)
* First steps toward pen tool, similar to spline tool currently. * Broken WIP * Progress, but still glitchy * Improvements, a little farther * Pen tool functioning as expected * Merged master * Fixed commit bug and overlay flashing * Reordered import statements TODO: Resolve issue with last segment losing its handle position on confirm
This commit is contained in:
committed by
Keavon Chambers
parent
f8c2be83dd
commit
d084775d81
@@ -508,6 +508,18 @@ impl Document {
|
||||
|
||||
Some([vec![DocumentChanged, CreatedLayer { path: path.clone() }]].concat())
|
||||
}
|
||||
Operation::AddShape {
|
||||
path,
|
||||
transform,
|
||||
insert_index,
|
||||
style,
|
||||
bez_path,
|
||||
closed,
|
||||
} => {
|
||||
let shape = Shape::from_bez_path(bez_path.clone(), *style, *closed);
|
||||
self.set_layer(path, Layer::new(LayerDataType::Shape(shape), *transform), *insert_index)?;
|
||||
Some([vec![DocumentChanged, CreatedLayer { path: path.clone() }]].concat())
|
||||
}
|
||||
Operation::AddPolyline {
|
||||
path,
|
||||
insert_index,
|
||||
|
||||
@@ -88,6 +88,14 @@ pub enum Operation {
|
||||
style: style::PathStyle,
|
||||
closed: bool,
|
||||
},
|
||||
AddShape {
|
||||
path: Vec<LayerId>,
|
||||
transform: [f64; 6],
|
||||
insert_index: isize,
|
||||
bez_path: kurbo::BezPath,
|
||||
style: style::PathStyle,
|
||||
closed: bool,
|
||||
},
|
||||
DeleteLayer {
|
||||
path: Vec<LayerId>,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user