mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 02:48:12 +08:00
20cfd5f600ebf800aa394b2ed26f4acf6326fbce
9 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
20cfd5f600 |
Refactor internal shape and reduce reliance on Kurbo (#617)
* Dissolve Points from path * Add handling for removing the first anchor * Add function to turn handles into bez_paths * Created overlay manager, wip * WIP Refactor of VectorShape / Overlays / ShapeEditor * WIP stripping vector shape, anchor, point. * WIP Removed kurbo deps from vector shape, anchor, point * WIP Further work to make vector shapes / anchors / points more standalone. * WIP more pruning * WIP Progress on overlay_renderer * WIP more overlay_renderer work * WIP more pruning, cleared warnings * WIP decided ShapeRenderer wasn't an accurate name, ShapeAdapter now. Error squashing continues. * WIP squashed more errors, now need to decide if anchors should have unique IDs * WIP Errors squashed, now to actually make it work. * WIP Moved vector structs to graphene, beginning to remove bezpath from shape_layer * Refactoring: disentangle kurbo from apply_affine * Refactor internal shape and remove reliance on Kurbo (PR #617) - Disentangle Kurbo (#619) * Refactoring: disentangle kurbo from apply_affine * Broke boolean operations, refactor in state which compiles * "fixed" boolean operation refactor related errors * fixed apply_affine, which would not have applied any type of affine * Small Cleanup, readability * Fix issue with overlay styles no longer showing selection state. * Resolved error with point option * WIP, figuring out how to have one source of truth for VectorShape. Trying to avoid cloning. * WIP work on single source of truth vectorshapes * More steps toward single source of truth VectorShape * Continued wip on making VectorShapes mutably accessible without cloning * Wip using paths to reference vectorshapes instead, need to restructure ShapeEditor * Decided to allow temporary copies of vectorshapes. * Removed HashSet for selected shape indices * Added @TrueDoctor's id_storage.rs with some heavy modification. Added it to VectorShape. Isn't yet used for folders. * Integrated UniqueElements<T> with VectorShape to store VectorAnchors * Improved storage_id.rs perf and cleaned up it's interface * Iterator Implementations and fixes (#637) * Refactoring: disentangle kurbo from apply_affine * Broke boolean operations, refactor in state which compiles * "fixed" boolean operation refactor related errors * fixed apply_affine, which would not have applied any type of affine * implemented transforms for VectorAnchors implemented Not for VectorControlPointType * started adding Vector Shape implementations of shape prototypes * added several useful implemtations to UniqueElements * added another implemnation for UniqueElements to make working with iterators easier, fixed vector-shape errors * package-lock.json * clean up rebase, added back Layer paths * added deref implementation for VectorShape * unnecesary variable * simplify code by removing levels of indirection * fixed errors * merge cleanup * removed package-lock.json * Removed .selected from VectorShape, it isn't needed as layers are selected not shapes specifically. * Removed transform and layer_path from VectorShape * Auto-saving tentitively working. Work toward Overlay transform issues. * Overlays properly hiding and caching. Not clearing cache yet and some tool switching issues remain, but progress. * Putting layers in folders changes their unique ID. This is problematic. Assumed this was not the case. * Removed need for closed bool, changed VectorShape to a tuple struct. * WIP Switched to layer paths as opposed to VectorShapes. Next up add messages for changing VectorShapes. * Added initial messages to edit VectorShape points. * DeleteSelectedPoints messages implemented, selection isn't working currently though. * Selection messages arriving in document, but transform is wrong. * Selection, Deselection working, delete working for first point. * Working towards moving points again * Removed extra vec from UniqueElements, attempting to squash ordering bug. Still appears to occur though. * Delete more stable, clean up, renamed to HandleIn, HandleOut * Further vec_unique cleanup * Further cleanup * Removed Deref / DerefMut from VectorShape * Document version++, will likely revert before merge into master * Seleting / deleting handles tentitively working again. * Version number bump, fixed tests. * Fixed comment in VecUnique * Improved VecUnique descriptor comment * Renamed VecUnique to IdBackedVec to further clarify usage. * Resolved formatting. * WIP Fixing dragging points * Fixed an instance where an OverlayMessage could be sent to the main document incorrectly. * Deleting all of a shapes points now gracefully deletes the layer instead of crashing. * Fixed handle configurations that would panic on deletion * Single anchor dragging restored with multi-dragging next plus handles * sides.into() * Handle and Multi-point dragging working * WIP Handle symmetry working again * Handle mirroring functional again. * Cleaned up warnings * Fixed overlay outline not matching shape * Git branch fix of compatibility with new master * Fixed closed shape bug, replaced kurbo ellipse * Removed unused func, updated comments * Deleting points can undo, multiple shape selection deletes now working * Removed AddOverlay* operations * Partial fix for select drift, added helpers * Don't snap against dragging points * Properly cleanup path outline with multiple shapes * Clear all points in other selected shapes * Actually don't snap against dragging points * Fix path tool & add snap angle and break handle * Fix handle being set to NaN causing render issues * Fix cached overlays not showing line -> curve * Add operations for modifying paths * Remove kurbo from pen tool * Do not snap against handles when anchor selected * Fix overlays not being cleaned up on path tool * Fix handle position after dragging * Use `Anchor` for text & no kurbo in operations * Replace kurbo to_svg function * Ngon no longer center scales by default, still some weird behaviour when holding alt * Cleanup overlays * Fix render and bounding box doctests * Fix fun to_svg error * Fix compile error * Some code review * Remove legacy `SelectPoint` on doubleclick * Remove font from test document * Fix the pen tool selection changed * Reorder imports Co-authored-by: Dennis <dennis@kobert.dev> Co-authored-by: Caleb Dennis <caleb.dennis429@gmail.com> Co-authored-by: caleb <56044292+caleb-ad@users.noreply.github.com> Co-authored-by: Keavon Chambers <keavon@keavon.com> Co-authored-by: 0hypercube <0hypercube@gmail.com> Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com> |
||
|
|
79d40fa451 |
Snapping system improvements and refactor (#621)
* Snap to points and refactor * Improve dot position on bounds * Add snap matrix * Cleanup * Code review * Half axis fade rather than increase it * Fix fmt * Hide snap to point overlay when active Co-authored-by: Keavon Chambers <keavon@keavon.com> |
||
|
|
2aba0fc06b |
Gradient Tool (#546)
* Refactor to support fill enum & svg defs * Init tool * Fix advertise * Gradient tool click and drag * Overlays * Drag overlays * Cleanup * Fix transform on elongated shapes * Snap rotate * Snapping * Add hints * Rename to solid * Code review changes Co-authored-by: Keavon Chambers <keavon@keavon.com> |
||
|
|
c54774c4c3 |
Implement the Crop Tool for artboard resizing (#519)
* Extract transformation cage to a seperate file * Hook up tool * Implement resize * Draw artboards * centre and constrain * Bounding box is rotated * Fix transform handle positions for artboard * Drag layers * Snapping * Fix imports * Cleanup * Remove allocation from bounding_boxes * Round artboard size and position * Hints * Fix rotated transform cage * Code review changes * Hints changes Co-authored-by: Dennis <dennis@kobert.dev> Co-authored-by: Keavon Chambers <keavon@keavon.com> |
||
|
|
e51bb6b6c6 |
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 |
||
|
|
0a1717cf77 |
Transformation cage (#502)
* Render corners and edges of selection box * Refactor * Add drag detection * Implement the transform handles * Implement rotation by dragging <40px from bounds * Refine clustered handle behaviour * Add cursors * Add snap angle * Fix MMB drag whilst in select tool * Convert calculate_pivot into a seperate function * rename start_vec to start_offset * Fix typo * Remove Undo transaction on <10px mouse move Co-authored-by: Keavon Chambers <keavon@keavon.com> |
||
|
|
dae79caf15 |
Implement layer renaming (#501)
* Implement layer renaming * Fix sneaky typo in CSS Co-authored-by: Moritz Vetter <16950410+HansAuger@users.noreply.github.com> Co-authored-by: Moritz Vetter <16950410+HansAuger@users.noreply.github.com> |
||
|
|
d5236f485a |
Add alignment overlays (#462)
* Add alignment overlays * Made snapping / overlays not render extra times, made snapping distance larger * Revert snap tolerance change until user testing can be done * WIP conversion to messages * Revert "WIP conversion to messages" This reverts commit |
||
|
|
40d5960571 |
Massively reorganize and clean up the whole Rust codebase (#478)
* Massively reorganize and clean up the whole Rust codebase * Additional changes during code review |