Resolves 3 known bugs with the pen tool.
* Fixed crash pointed out by @caleb-ad
* Fixed issue with final path segment losing handle data
* Replace curves with lines when under a drag threshold, improves usability.
* Readability improvements, improved comments
* 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
* added BooleanUnion message for select tool, which is sent by the BooleanUnion button
* select to dispatches a BooleanUnion message
- as far as I can tell the selected layers aren't stored anywhere
* Added neccesary messages and functions for boolean operation
* Intersection code, as yet untested
does not compile
* Updated intersection algorithm
* Fixed shapes_as_seen
- should not be effected by root transform, should be effected by the shape transform
Working line intercepts
* updated intersection algorithm
* added SubCurve struct, to reduce creation of new PathSegs and more efficiently calculate bounding boxes
* intersection algorithm modifications
* changed sub_curve to do less copying
* intersection algorithm working for ellipses
- idk why though, the algorithm isn't finding close, but nearby intersections
* Code for the sub-shape identification pieces of boolean operation algorithm
* cycle direction calculations
boolean_operation code
* final touches (a.k.a. the very begining touches before the debugging)
* removed intersection testing code to draw intersects
added code to add new shapes to document
* Bug Fix: Cycle needs to track egde origin
Bug Fix: vertex markers
Working for simple shapes
* Bug Fix: multiple intersections in same PathSeg
* Bug Fix: compare the absolute value of area magnitudes
* Bug Fix: subdivision algorithm
* cargo fmt
* comments
* Bug Fix: Difference and Subtraction operations
* simplified overlap
* changed shapes_as_seen to transformed_shapes
- modified function to use existing code for multiplying transforms and traversing layer tree
removed shape_as_seen, helper function to shapes_as_seen
* Bug Fix: selected layers must be sorted
* Changed SubFront to SubtractFront and SubBack to SubtractBack
* moved F64PRECISION to graphene::consts
* Best practices changes
intersection algorithm changes
* Added BooleanOperationError
* modified intersection algorithm to use more dynamic thresholds
* intersection algorithm modification
* Added "do_if"
* Bug Fix: properly subdivide segments with multiple intersections
* Added tests for intersection algorithm
* restructured flow control in intersection algorithm
restructured intersection algorithm to modify single vector
- should have done this yeeeaars ago
* Shapes will have the pathstyle of alpha
* collect_shapes now uses closure
* BugFix: fixed PathGraph:get_cycles, prevent multicounting cycles
* Added boolean_ops::reverse_path function
* Curves are now reversed before intersections are found
* cleanup
* BugFix: subfront and subback chose wrong shape pathstyle
BugFix: path concat should remove internal movetos and closepaths
* BugFix: prevent movetos from being added due to intersect imprecision
* Changed intersection quality threshhold to CURVE_FIDELITY
* Added functions for cubic/quadratic roots
!Does not compile!
* Added special case algorithms for line-curve intersections
Added tests for cubic root algorithm
* changed line_curve_intersections structure
* Handle intersecting shape without curve intersection case
* Behavior for SubtratFront, SubtractBack, Union, and Intersection for the no-intersect cases
* reformatted PathGraph::add_edges_from_path
Fixed bugs involving closepaths and subpaths
* Bug fix: fix refactoring error
* Bug fix: don't consider 0 length cycles
Bug Fix: dummy vertices are not intersections
* the function document_message_handler::sort_layers sorts the layers from bottom to top
- we want the reverse
* Bug Fix: ClosePath must be appended to shapes constructed from cycle
- By default PathGraph edges are not closed.
- When the input shape was not closed there would be multiple unclosed paths in the resulting shape, causing bugs
* close_path now closes all subpaths in a path
- if a shape has any subpath which is not closed boolean operations are undefined
(Also PathGraph::add_edges_from_path breaks when the path isn't closed)
* clean up
* removed unused function "intersectoin_candidates"
* comments
* removed duplicate check for valid intersection in horizontal_ray_cast
* Temporary fix for ray casting
* it wouldn't build cause one of these ->' pesky things was hanging around in the wrong neighborhood
* ignoring intersection test cases because they do exact fp comparison
* Some spelling fixes and abbreviation burnination (more needed)
* spelling fixes
close_path bug
* Fixed: local extrema were not being properly filtered out for subcurves
Fixed: reversing PathSeg removes any closepaths
* spelling
* Code review pass
* partial implementation overlapping identical curves
* Untested implementation for test for overlapping curves
- Test is not yet used in intersection algorithm
* -Removed PathGraph::intersect()
* readability improvements
changed line_t_value to be more forgiving to error
* Bug Fix: match_control_polygon didn't properly compare different degree polygons
* Added colinear() function
Added projection_on_line() function
* BugFix project_onto_line
* removed extra log
* rust fmt
Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: TrueDoctor <dennis@kobert.dev>
* initial layout system with tool options
* cargo fmt
* cargo fmt again
* document bar defined on the backend
* cargo fmt
* removed RC<RefCell>
* cargo fmt
* - fix increment behavior
- removed hashmap from layout message handler
- removed no op message from layoutMessage
* cargo fmt
* only send documentBar when zoom or rotation is updated
* ctrl-0 changes zoom properly
* unfinished layer hook in
* fix layerData name
* layer panel options bar
* basic x/y movment
* working transform section
* changed messages from tuples to structs
* hook up text input
* - fixed number input to be more clear
- fixed actions for properties message handler
* Add styling
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* 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
* 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
* Always set shape property 'closed' on fill
* Remove closed property on Shape
* Make color mandatory in Fill
* Fix intersection for filled but open shapes
* Code style tweak
* Add TODO note to rework ClosePath check
* Fix firefox text input
* Fix descenders below bounding box
* Fix chromium empty text
* Descenders back below baseline
* Fix trailing newline on chromium
* Reinstate correct baseline height
* Fix highlighted new line on empty text
* Add comment for trailing new line removal
* Extract cleanupTextInput to a separate file
* Function import simplification
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* initial layout system with tool options
* cargo fmt
* cargo fmt again
* document bar defined on the backend
* cargo fmt
* removed RC<RefCell>
* cargo fmt
* - fix increment behavior
- removed hashmap from layout message handler
- removed no op message from layoutMessage
* cargo fmt
* only send documentBar when zoom or rotation is updated
* ctrl-0 changes zoom properly
* Code review changes
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* Add text tool
* Double click with the select tool to edit text
* Fix (I think?) transitioning to select tool
* Commit and abort text editing
* Transition to a contenteditable div and autosize
* Fix right click blocking
* Cleanup hints
* Ctrl + enter leaves text edit mode
* Render indervidual bounding boxes for text
* Re-format space indents
* Reflect font size in the textarea
* Fix change tool behaviour
* Remove starting text
* Populate the cache (caused doc load bug)
* Remove console log
* Chrome display the flashing text entry cursor
* Update overlay on input
* Cleanup input.ts
* Fix bounding boxes
* Apply review feedback
* Remove manual test
* Remove svg from gitignore
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* Add folder insert outline
* Fix typo
* Use v-bind for insert folder class
* Remove v-bind prefix
* Convert to using v-if for the insert marker
* Simplify Vue-based insertion lines with pseudo elements
Regression I caused: can't insert in bottom of folder listing
* Fix the insertion-at-bottom-of-folder bug
* Apply folder insertion to the layer not its row
* Convert to using an absolutly positioned marker
* Remove v-bind prefix
* Remove other v-bind prefix
* Cleanup css
* Little code review nitpicks
* Better name for closest
* Rename js constants
Co-authored-by: Keavon Chambers <keavon@keavon.com>