Files
Graphite/editor/src/viewport_tools/tool_message.rs
Oliver Davies 108b8be595 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
2022-02-09 12:49:14 -08:00

100 lines
1.8 KiB
Rust

use super::tool::ToolType;
use crate::message_prelude::*;
use graphene::color::Color;
use serde::{Deserialize, Serialize};
#[remain::sorted]
#[impl_message(Message, Tool)]
#[derive(PartialEq, Clone, Debug, Serialize, Deserialize)]
pub enum ToolMessage {
// Sub-messages
#[remain::unsorted]
#[child]
Select(SelectMessage),
#[remain::unsorted]
#[child]
Crop(CropMessage),
#[remain::unsorted]
#[child]
Navigate(NavigateMessage),
#[remain::unsorted]
#[child]
Eyedropper(EyedropperMessage),
// #[remain::unsorted]
// #[child]
// Text(TextMessage),
#[remain::unsorted]
#[child]
Text(TextMessage),
#[remain::unsorted]
#[child]
Fill(FillMessage),
// #[remain::unsorted]
// #[child]
// Gradient(GradientMessage),
// #[remain::unsorted]
// #[child]
// Brush(BrushMessage),
// #[remain::unsorted]
// #[child]
// Heal(HealMessage),
// #[remain::unsorted]
// #[child]
// Clone(CloneMessage),
// #[remain::unsorted]
// #[child]
// Patch(PatchMessage),
// #[remain::unsorted]
// #[child]
// Detail(DetailMessage),
// #[remain::unsorted]
// #[child]
// Relight(RelightMessage),
#[remain::unsorted]
#[child]
Path(PathMessage),
#[remain::unsorted]
#[child]
Pen(PenMessage),
#[remain::unsorted]
#[child]
Freehand(FreehandMessage),
// #[remain::unsorted]
// #[child]
// Spline(SplineMessage),
#[remain::unsorted]
#[child]
Line(LineMessage),
#[remain::unsorted]
#[child]
Rectangle(RectangleMessage),
#[remain::unsorted]
#[child]
Ellipse(EllipseMessage),
#[remain::unsorted]
#[child]
Shape(ShapeMessage),
// Messages
#[remain::unsorted]
NoOp,
AbortCurrentTool,
ActivateTool {
tool_type: ToolType,
},
DocumentIsDirty,
ResetColors,
SelectionChanged,
SelectPrimaryColor {
color: Color,
},
SelectSecondaryColor {
color: Color,
},
SwapColors,
UpdateCursor,
UpdateHints,
}