Implement anchor and handle point rendering with the Path Tool (#353)

* Implement Path Tool

* Draw a red rectangle where the first point on the shape is

* Correctly render anchors, handles, and connecting lines

* Fix drain() which can panic

* Refactor frontend messages to work as return values not callbacks

* Reduce the number of unnecessary frontend updates

* Fix stack overflow by using a loop

* Group Document Render calls and put them at the end

* Speed hacks for dirtification

* Add performance

* Bunch folder changed updates

* Add triggers to redraw overlays to movement_handler

* Polish the pixel-perfect rendering of vector manipulators

* Restore scrollbars that were disabled

* Cleanup

* WIP Add shape outline rendering

* Fix compiling

* Add outlines to selected shapes

* Fix outlines rendering over handles and anchors

* Fix dirtification

* Add a comment

* Address code review feedback

* Formatting

* Small tweaks

Co-authored-by: Oliver Davies <oliver@psyfer.io>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
Keavon Chambers
2021-08-29 00:10:54 -07:00
co-authored by Oliver Davies Dennis Kobert
parent 4421b79ec4
commit 024ce9dcfa
41 changed files with 759 additions and 282 deletions
+32 -4
View File
@@ -20,13 +20,18 @@ pub enum Operation {
transform: [f64; 6],
style: style::PathStyle,
},
AddOverlayEllipse {
path: Vec<LayerId>,
transform: [f64; 6],
style: style::PathStyle,
},
AddRect {
path: Vec<LayerId>,
insert_index: isize,
transform: [f64; 6],
style: style::PathStyle,
},
AddBoundingBox {
AddOverlayRect {
path: Vec<LayerId>,
transform: [f64; 6],
style: style::PathStyle,
@@ -37,6 +42,11 @@ pub enum Operation {
transform: [f64; 6],
style: style::PathStyle,
},
AddOverlayLine {
path: Vec<LayerId>,
transform: [f64; 6],
style: style::PathStyle,
},
AddPen {
path: Vec<LayerId>,
transform: [f64; 6],
@@ -44,13 +54,18 @@ pub enum Operation {
points: Vec<(f64, f64)>,
style: style::PathStyle,
},
AddShape {
AddNgon {
path: Vec<LayerId>,
insert_index: isize,
transform: [f64; 6],
sides: u8,
style: style::PathStyle,
},
AddOverlayShape {
path: Vec<LayerId>,
bez_path: kurbo::BezPath,
style: style::PathStyle,
},
DeleteLayer {
path: Vec<LayerId>,
},
@@ -81,6 +96,11 @@ pub enum Operation {
path: Vec<LayerId>,
transform: [f64; 6],
},
SetShapePathInViewport {
path: Vec<LayerId>,
bez_path: kurbo::BezPath,
transform: [f64; 6],
},
TransformLayerInScope {
path: Vec<LayerId>,
transform: [f64; 6],
@@ -95,9 +115,13 @@ pub enum Operation {
path: Vec<LayerId>,
transform: [f64; 6],
},
ToggleVisibility {
ToggleLayerVisibility {
path: Vec<LayerId>,
},
SetLayerVisibility {
path: Vec<LayerId>,
visible: bool,
},
SetLayerBlendMode {
path: Vec<LayerId>,
blend_mode: BlendMode,
@@ -106,7 +130,11 @@ pub enum Operation {
path: Vec<LayerId>,
opacity: f64,
},
FillLayer {
SetLayerStyle {
path: Vec<LayerId>,
style: style::PathStyle,
},
SetLayerFill {
path: Vec<LayerId>,
color: Color,
},