Overhaul Path Tool (#498)

* First pass cleanup omw to handles

* Handles dragging with anchors, handles still not draggable and some bugs

* Dragging single side of handle works, need to create mirror case

* In progress addition of improved anchor / handle representation

* partially working

* Handle dragging working for non-end points, normal anchor drag bugged

* Fixed corner cases, fixed anchors without handles bug

* Add snapping

* Change path tool selection by clicking on shape

* Fixed path close point being draggable

* Variable length handle, firstpass of alt to stop mirroring

* Alt improved, not done. Only update structures when needed. Added snapping for selected shapes

* Can now undo path edits

* Do not maintain angle between non-mirrored handles

* Replaced segment based overlay setup with anchor based setup

* Cleanup, handle angle comparison bug remains. Investigating.

* Added OverlayPooler. May closely associate overlays to VectorManipulatorAnchors instead.

* Moved anchor / segment creation logic out of document_message_handler

* Overlays are now managed by VectorManipulatorShapes

* Fixed inconsistent handle mirroring.

* Clearly shows which point you have selected

* Removed OverlayPooler system

* Added more comments

* Removed all clones of the vector structures. A little uglier but better.

* Resolved Text path initialization bug with a workaround.

* Cleaned up comments

* More comment cleanup

* Fixed issue with quad handle dragging unwanted behavior, renamed VectorShapeManipulator

* In progress refactor to allow multi-selection

* In progress dragging multiple points, selection works, transform still has issues

* Added Multiselect, major refactor

* Commented out progress for selection change, bug with hop back on multiple shapes

* Removed debug og

* Resolved issue with merge

* Minor cleanup, added a few comments

* Review changes

* Resolved unclear comment

* Fixed snap back for now

* Add todo comment for future snap back fix

* Working situations where curve paths do not close. Thanks for points it out  @pkupper

* Tweaked selection size

* Fix curve start point dragability, renames, cleanup

* Separated into multiple files, applied @TrueDoctor review feedback

* Resolved tests failing due to doc generation

* Re-added closed, added concept of distance mirroring

* Added shift distance mirroring, removed debounce from anchor

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Thank you for the reviews @TrueDoctor and @pkupper
This commit is contained in:
Oliver Davies
2022-02-09 12:49:14 -08:00
committed by Keavon Chambers
parent bd844aaf94
commit 108b8be595
17 changed files with 1407 additions and 526 deletions
+5
View File
@@ -179,6 +179,7 @@ impl fmt::Display for ToolType {
pub enum StandardToolMessageType {
Abort,
DocumentIsDirty,
SelectionChanged,
}
// TODO: Find a nicer way in Rust to make this generic so we don't have to manually map to enum variants
@@ -231,6 +232,10 @@ pub fn standard_tool_message(tool: ToolType, message_type: StandardToolMessageTy
ToolType::Shape => Some(ShapeMessage::Abort.into()),
_ => None,
},
StandardToolMessageType::SelectionChanged => match tool {
ToolType::Path => Some(PathMessage::SelectionChanged.into()),
_ => None,
},
}
}