Commit Graph

517 Commits

Author SHA1 Message Date
Keavon Chambers f6726c1427 Various website fixes 2022-03-17 02:12:23 -07:00
Keavon Chambers 36d67393b9 Small website text improvements 2022-03-15 16:06:09 -07:00
TrueDoctor f27ab59a79 Fix type error in Brave browser (#569) 2022-03-15 19:10:45 +01:00
0HyperCube 7ee2fcad44 Fix clippy lints and update packages (#568)
# Conflicts:
#	Cargo.lock
2022-03-14 21:23:08 +00:00
Keavon Chambers 593aa99ffa Add features page and fixes to website 2022-03-13 11:32:53 -07:00
Keavon Chambers d4f62ba01d Add website revisions and many new pages 2022-03-12 08:31:12 -08:00
Keavon Chambers 2f6722fb40 Add Image node icon and rename node from Path to Shape 2022-03-05 23:51:59 -08:00
Keavon Chambers 3d8108a32b Change tool shelf icon colors to use classes not style 2022-03-05 18:28:41 -08:00
Keavon Chambers 788f8db127 Remake node type icons (closes #483); color picker cleanup 2022-03-04 22:48:22 -08:00
Keavon Chambers 8a05712dac Reorder tool icons, update favicon and logo, and other icon cleanup 2022-03-04 13:04:59 -08:00
Keavon Chambers bd9571103e Set text color based on its fill when it's being edited 2022-03-04 12:15:42 -08:00
Keavon Chambers 0bdb08f34d Update npm dependencies 2022-03-02 22:02:40 -08:00
Keavon Chambers f128434e50 Add "New Folder"/"Delete Selected" buttons to layer panel
Closes #532
2022-03-02 21:55:32 -08:00
mfish33 8387ffe735 Color Input (#565)
* initial working prototype

* clean up component

* Fix alignment

* Code review tweaks

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-02-22 13:52:58 -08:00
Oliver Davies 38a4dfd8bc Pen tool fixes (#563)
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
2022-02-20 19:47:04 -08:00
Keavon Chambers 8c248f386e Add newsletter signup to website 2022-02-19 03:31:02 -08:00
Keavon Chambers 248e2ab0d1 Website responsive resizing improvements 2022-02-19 02:15:28 -08:00
Keavon Chambers 3f79df7314 Create project website with near-complete home page 2022-02-17 02:44:02 -08:00
Dennis 4757e8b8cd Fix panic on non existing document layer 2022-02-16 17:41:45 +01:00
mfish33 37476fc19d fix crash when shape does not have fill (#557) 2022-02-15 16:57:44 -08:00
mfish33 a73d9b5811 Can set stroke and fill on text and shapes (#551)
* 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
2022-02-15 09:04:11 -08:00
0HyperCube 93dffb8741 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>
2022-02-14 23:07:11 +00:00
0HyperCube 8bf1289429 Reduce transformation cage rotate tolerance (#548) 2022-02-13 21:49:06 +00:00
0HyperCube 916d10980d Rename tools (#537)
* Rename tools

* Rename Text -> TextLayer
2022-02-12 19:04:34 +00:00
Keavon Chambers 31fb0d7148 Release Alpha Milestone 1! 2022-02-12 09:31:48 -08:00
caleb f9f66db5a2 Boolean shape operations (#470)
* 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>
2022-02-12 09:30:08 -08:00
mfish33 91e4201cb1 Implement the Properties panel with a transform section for layers (#527)
* 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>
2022-02-12 08:22:57 -08:00
Oliver Davies d084775d81 Add Pen Tool (#536)
* 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
2022-02-12 04:16:31 -08:00
mfish33 f8c2be83dd Properly show document bar on initialization (#535)
* properly show document bar

* updated comments
2022-02-11 11:32:10 -08:00
0HyperCube 011f32395e Allow deleting artboards (#533) 2022-02-10 20:03:14 +00:00
Keavon Chambers 77dc125095 Polishing: standardize binding JS resize event (fixes non-integer AA rendering); remove "X" to delete; cleanup 2022-02-10 02:29:45 -08:00
Keavon Chambers a4d3c343a0 Improve Path Tool hint text 2022-02-09 16:52:54 -08:00
Paul Kupper f8e72be492 Implement the Spline Tool (#512)
* Add Spline Tool

* Adapt to changes from master

* Apply review feedback

* Fixes

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-02-10 01:22:57 +01:00
0HyperCube 45edeb2a2b 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>
2022-02-09 23:22:23 +00:00
0HyperCube 29485001e9 Fix TextInput widget casting from string to number by mistake (#528) 2022-02-09 23:12:56 +00:00
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
Keavon Chambers bd844aaf94 Add the TextInput widget (#518)
* Separate out the number input from a generic field input

* Add TextInput widget

Co-authored-by: mfish33 <32677537+mfish33@users.noreply.github.com>
2022-02-09 12:16:44 -08:00
Wuelle cc66ab06b0 Place new layers in tree based on layer selection (#526)
* place new layers based on layer selection
2022-02-09 19:54:38 +01:00
Paul Kupper cb9a37b638 Set text fill color to the primary color (#521)
* Fix text has no fill

* Use primary color for text fill

* Use correct text color when editing

* Change fallback text color to gray
2022-02-07 20:58:22 +01:00
TrueDoctor 5ea4654f53 De duplicate Overlay render messages (#520) 2022-02-07 19:15:25 +01:00
Paul Kupper 386c970b60 Fix shape not closed after using Fill Tool (#510)
* 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
2022-02-06 23:06:23 +01:00
Keavon Chambers ca46767cf2 Solve "Coming Soon" dialog from bubbled click event on sub-menu entries (#517) 2022-02-05 13:49:12 -08:00
dependabot[bot] 10878dba6f Bump nanoid from 3.1.30 to 3.2.0 in /frontend (#514)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.30 to 3.2.0.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.30...3.2.0)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-05 13:22:41 -08:00
dependabot[bot] b9e3d0fda6 Bump follow-redirects from 1.14.5 to 1.14.7 in /frontend (#515)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.5 to 1.14.7.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.5...v1.14.7)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-05 13:12:44 -08:00
Paul Kupper 62fc269b8a Add log level selection to help menu (#511)
* Add log level selection to help menu

* Show keyboard shortcuts in loglevel menu items
2022-02-05 19:53:42 +01:00
0HyperCube 492025e79b Double click on a SimpleShape to path edit (#507) 2022-02-05 17:19:32 +00:00
0HyperCube 599a9d076b 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>
2022-02-04 16:46:44 +00:00
0HyperCube 2a313471d8 Clean up text input (#506)
* 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>
2022-02-04 04:26:44 +00:00
Keavon Chambers e9116a4775 Rename deployment script 2022-02-03 18:29:02 -08:00
0HyperCube 794980fb33 Fix overlays on document switching (#505)
* Fix overlays on document switching

* Fix generating new document

* Move messages

* Abort tool when deleteing active document

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-02-03 19:08:39 +00:00