Commit graph

2382 commits

Author SHA1 Message Date
Keavon Chambers
fe4a76a395 Implement the Edit > Paste menu entry (#683)
Closes #682
2022-06-19 00:53:33 -07:00
mfish33
5d6d2b22bc Menu bar definition in backend (#681)
* initial menu layout working

* removed api.rs functions

* no action shortcut for no-op

* code review

* nitpicks
2022-06-18 18:46:23 -06:00
Keavon Chambers
9bd27ec3f8 Change MenuList checkbox to be an icon from a widget 2022-06-17 17:55:04 -07:00
Keavon Chambers
ea0dbd1290 Add code style formatting to the website 2022-06-16 22:57:15 -07:00
Hannah Li
9f76315bdc Beginnings of the bezier-rs math library (#662)
Co-authored-by: Thomas Cheng <35661641+Androxium@users.noreply.github.com>
Co-authored-by: Robert Nadal <Robnadal44@gmail.com>
Co-authored-by: ll2zheng <ll2zheng@uwaterloo.ca>
2022-06-16 20:50:58 -04:00
Keavon Chambers
18a7c6a289 Update npm dependencies (#678) 2022-06-13 12:32:01 -07:00
0HyperCube
faecef40af Fix Ctrl+Enter to commit text (#675) 2022-06-11 12:01:31 +01:00
0HyperCube
3a30cdbb70 Add font menu previews and virtual scrolling (#650)
* Keyboard menu navigation

* Fix dropdown keyboard navigation

* Fix merge error

* Some code review

* Interactive dropdowns

* Query by data attr not class name

* Add locking behaviour

* Add font prieviews

* Remove blank line in css

* Use default for interactive in struct

* Use menulist for fontinput

* Polish

* Rename state -> manager

* Code review

* Cleanup fontinput

* More cleanup

* Make fonts.ts an empty state

* Fix regression

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-06-10 23:21:10 +01:00
mfish33
a26a0ddfcf Implement viewport culling (#667)
* culling is working

* fixed tests

* Ready for review

* cleanup

* code review

* Fix import

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-06-10 14:38:42 -07:00
0HyperCube
6f6c67a508 Fix hover outline when panning (#673) 2022-06-10 21:33:36 +01:00
0HyperCube
0887e56533 Fix nudge and textbox creation (#672)
* Fix nudge and textbox creation

* Code review

* Cleanup veriable names
2022-06-10 17:25:37 +01:00
Nupsi
a02b7a4635 Preserve layer stacking order on copy and paste (#668)
Fix Issue#610

Fix Issue#610  by reversing the direction of the copy buffer entry vector. This will preserve the layer ordering and match the behaviour of PasteIntoFolder.
2022-06-08 08:03:48 +03:00
mfish33
e623f7cc41 Fix crash on closing all documents (#666)
* editor does not crash on close all documents

* unused import

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-06-07 10:13:40 -07:00
mfish33
359687f478 Fix crash when deselecting layer while editing properties (#665)
- Remove field acsess after destruction
2022-06-06 18:59:39 -07:00
Keavon Chambers
0f93cc1e17 Update banner for the lastest blog post 2022-06-06 16:09:42 -07:00
0HyperCube
8923b68e30 Refactor font loading from per-document to the portfolio (#659)
* Cleanup default font loading

* Refactor fonts

* Fix menulist mouse navigation

* Format

* Formatting

* Move default font into consts.rs

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-05-27 00:27:33 +01:00
Rahul
d4539bc304 Fix viewport tilt/zoom while snapping to show snapped values (#663) 2022-05-26 13:24:46 -05:00
Keavon Chambers
c4dc999a38 Update readme 2022-05-25 00:27:29 -07:00
0HyperCube
81c3420470 Keyboard menu/widget navigation (#628)
* Keyboard menu navigation

* Fix dropdown keyboard navigation

* Fix merge error

* Some code review

* Interactive dropdowns

* Query by data attr not class name

* Add locking behaviour

* Change query selector style

* Change query selector style (again)

* Code review feedback

* Fix highlighted entry regression

* Styling and disabling checkbox tabindex in MenuLists

* Don't redirect space off canvas to backend

* Do not emit update if value same

* Escape closes all floating menus

* Close dropdowns on blur

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-05-25 22:10:18 +01:00
Keavon Chambers
8b94c62697 Refactor source of Git commit build info (closes #661) 2022-05-24 14:33:58 -07:00
0HyperCube
b624405b0c Fix paste into UI (#654)
* Keyboard menu navigation

* Fix dropdown keyboard navigation

* Fix merge error

* Add font prieviews

* Fix paste into UI

* Fix paste UI

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-05-24 04:01:36 +01:00
Keavon Chambers
d5b43ef2da Add frontend file structure docs and some related cleanup 2022-05-23 19:13:51 -07:00
Keavon Chambers
e4e37cca7b Reorganize Vue components and add documentation explaining each folder 2022-05-23 19:03:34 -07:00
Keavon Chambers
5650a87465 Update the assets directory to prefix icon folders with "icon-" 2022-05-22 00:06:10 -07:00
Hannah Li
860c4ad6aa Add basic support for radial gradients (#639)
* Add SVG string generator for radial gradients

* Add the UI for the linear vs radial radio inputs

* Initial radial gradient support for gradient tool

* Enabled click and drag support for radial gradients

* Refactor code for gradient in properties panel

* Added gradient type to gradient struct

* Finish refactor to use gradient_type instead of fill

* Fix lint issue

* Combine LinearGradient and RadialGradient in Fill enum

* Add label to properties panel and fix bug

Co-authored-by: Robert Nadal <Robnadal44@gmail.com>
Co-authored-by: Oliver Davies <oliver@psyfer.io>
2022-05-23 20:00:53 -04:00
Keavon Chambers
fc2d983bd7 Vue initialization and FloatingMenu codebase refactoring and cleanup (#649)
* Clean up Vue initialization-related code

* Rename folder: dispatcher -> interop

* Rename folder: state -> providers

* Comments and clarification

* Rename JS dispatcher to subscription router

* Assorted cleanup and renaming

* Rename: js-messages.ts -> messages.ts

* Comments

* Remove unused Vue component injects

* Clean up coming soon and add warning about freezing the app

* Further cleanup

* Dangerous changes

* Simplify App.vue code

* Move more disparate init code from components into managers

* Rename folder: providers -> state-providers

* Other

* Move Document panel options bar separator to backend

* Add destructors to managers to fix HMR

* Comments and code style

* Rename variable: font -> font_file_url

* Fix async font loading; refactor janky floating menu openness and min-width measurement; fix Vetur errors

* Fix misaligned canvas in viewport until panning on page (re)load

* Add Vue bidirectional props documentation

* More folder renaming for better terminology; add some documentation
2022-05-21 19:46:15 -07:00
Thomas Cheng
4c3c925c2c Fix polygon overflow (#644)
* changed polygon side to u32 + set max polygon side to 1000

* revert unnecessary change

* Include unwrap for vertices input
2022-05-20 16:40:01 -04:00
Keavon Chambers
29e00e488b Move layouts definitions to backend and fix Firefox overlay scrollbars (#647)
* Fix two-axis scrollbars in scrollable regions on Firefox

* Move Document Mode dropdown to the backend; and related code cleanup

* Port the Layer Tree options bar layout to the backend

* Port the tool shelf to the backend

* Clean up initialization and wasm wrapper

* Fix crash

* Fix missing document bar

* Remove unused functions in api.rs

* Code review

* Tool initalisation

* Remove some frontend functions

* Initalise -> Init so en-US/GB doesn't have to matter :)

* Remove blend_mode and opacity from LayerPanelEntry

Co-authored-by: 0hypercube <0hypercube@gmail.com>
2022-05-17 13:12:52 -07:00
Keavon Chambers
e7d63276ad Update the VS Code rust-analyzer extension to its new official owner 2022-05-13 12:09:37 -07:00
Keavon Chambers
3480cc93d9 Fix website rendering issues on Firefox with -webkit-line-clamp 2022-05-12 13:34:26 -07:00
Keavon Chambers
ff57fef77c Fix website responsive layouts 2022-05-12 13:08:53 -07:00
0HyperCube
eb43f0b0a5 Restore the zoom to fit behaviour in new bounded documents (#641)
* Restore the zoom to fit behaviour

* cargo fmt

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-05-12 19:31:35 +01:00
Keavon Chambers
3673490990 Add Reddit and Twitter links to blog posts 2022-05-12 01:15:56 -07:00
Keavon Chambers
13417b26e7 Fix website URL encoding in certain links 2022-05-12 01:04:23 -07:00
Keavon Chambers
44f3ad27ec Blog post updates 2022-05-12 00:45:20 -07:00
Keavon Chambers
19b2d3f859 Build the node graph frontend with placeholder graph info (#581)
* Build the node graph frontend

* Graph pan and zoom

* Graph's dot grid now pans/zooms also

* Interactive horisontal to vertical curves

* Data types and zooming on wires

* Icon definitions code beautification

* Add a visibility toggle

Co-authored-by: 0hypercube <0hypercube@gmail.com>
2022-05-10 22:34:25 -07:00
Keavon Chambers
5571f39b41 Update list of recommended VS Code extensions 2022-05-10 20:39:58 -07:00
caleb
0f36329811 Shape boolean operation improvements (#547)
* changed path_intersection structure

* comment

* Removed do_if!

* Create project website with near-complete home page

* Added support for undoing
    - i gotta say the undo system is quite nice

* Website responsive resizing improvements

* Add newsletter signup to website

* 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

* Color Input (#565)

* initial working prototype

* clean up component

* Fix alignment

* Code review tweaks

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Made the non-inclusive end of a pathseg less inclusive
Fixed Bug: When doing a closepath it is possible that the current and beginning edge are both None
Fixed Numerous other things

* changed how closepath works
modified how overlapping_curve_intersections is working

* Add "New Folder"/"Delete Selected" buttons to layer panel

Closes #532

* Update npm dependencies

* Set text color based on its fill when it's being edited

* Reorder tool icons, update favicon and logo, and other icon cleanup

* Bug Fix: Line-Line intersect origin wasn't being preserved

* Bug Fix: proper assignment of t_values in overlapping_curve_intersections

* Honestly, i don't even know what I was thinking when i wrote the logic for splitting a subcurve at endpoints, but it was wrong.

* Feature: overlapping rectangles behave properly, (except when intersections aren't found correctly)

* Remake node type icons (closes #483); color picker cleanup

* Change tool shelf icon colors to use classes not style

* Add Image node icon and rename node from Path to Shape

* Bug Fix: proper intersection construction in partial overlap case

* cleaned up log statements

* Add website revisions and many new pages

* Add features page and fixes to website

* Fix clippy lints and update packages (#568)

* Fix type error in Brave browser (#569)

* Small website text improvements

* Various website fixes

* Adjusted constants
Rearranged intersection algorithm

* Changed BooleanOperation::SubtractBack to use SubtractFront
Added composite_boolean_operation for operations with more than one shape

* Add node graph mockup to website

* Differentiate between scale and dimensions (#570)

* Differentiate between scale and dimensions

* Fix layout and naming of properties

* Add embedable images (#564)

* Add embedable bitmaps

* Initial work on blob urls

* Finish implementing data url

* Fix some bugs

* Rename bitmap to image

* Fix loading image on document load

* Add transform properties for image

* Remove some logging

* Add image dimensions

* Implement system copy and paste

* Fix pasting images

* Fix test

* Address code review

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Bump minimist from 1.2.5 to 1.2.6 in /frontend (#571)

Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix panic dialogue when handling a message (#573)

* Fix panic dialogue when handling a message

* Fix indents for github reporting

* More whitespace improvements

* Save: line_intersection

* Add documentation to many parts of the Rust codebase (#552)

* add lots of doccomments

* add conversion traits from layerdatatypes to layers

* add suggested doc improvements

* Code review changes

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add additional stroke properties (#582)

* Add aditional stroke properties

* Add comment explaining clones for closure

* Improve labels

* Fix doc test

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Bug Fix: .y not .x

* Expand upon the "Announcing Graphite alpha" blog post

* All shapes now have a Fill in the properties panel; color inputs are now optional (#583)

* Add aditional stroke properties

* Make the colour input optional

* Fix fmt

* Apply code review changes

* Code review nitpicks

* Fix recursion

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* New blog post: "Distributed computing with the Graphene runtime"

* Fix gradient transformation (#588)

* Fix with perfect circle

* Actually fix rotated gradient

* Gradient transform & fix on rotated canvas

* Cleanup & remove logging

* Add properties panel entries for artboards (#572)

* Artboards can have properties

* fix crash when renaming artboards

* moved target document to utility types

* moved import and added test for file version information

* fixed missing import

* fix error from merging

* - typed properties message handler data
- removed name from WidgetRow

* clippy warnings

* artboards have seperate properties section

* - color input can be forced to have selection
- crop tool shows on switch
- select tool shows on switch

* variable renamed

* change to use PropType<boolean> instead of PropType<Boolean>

* Add an artboard icon

* Add the "Delete Artboard" hint

* fix unselect glitch

* even better

* Remove the Transform properties group

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Bug Fix: boolean union on multiple shapes

* Font selection for text layers (#585)

* Add font dropdown

* Add fonts

* Font tool options

* Fix tests

* Replace http with https

* Add variant selection

* Do not embed default font

* Use proxied font list API

* Change default font to Merriweather

* Remove outdated comment

* Specify font once & load font into foreignobject

* Fix tests

* Rename variant to font_style

* Change TextAreaInput to use FieldInput (WIP, breaks functionality)

* Fix textarea functionality

* Fix types

* Add weight name mapping

* Change labeling of "Italic"

* Remove commented HTML node

* Rename font "name" to "font_family" and "file" "font_file"

* Fix errors

* Fix fmt

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Improvements to the layer transform cage UX (#589)

* Allow input system to handle mousedown while dragging

* Fix abort

* Add apsect ratio

* Make comment more explicit

* Fix abort when dragging

* Constrain when dragging edge

* Rename Crop tool to Artboard tool

* Stop pointerdown event from properties panel (#600)

* Change stroke weight from ints to floats (#601)

Also rename stroke "width" to "weight" in some places. Closes #587

* Change stroke weight from ints to floats

* "miter_limit" -> "line_join_miter_limit"

* Bump file format version

* cargo update
Prevent iterating beyond list bounds

* Bug fix: proper composite intersection behavior

* fix warnings

* Improved ray casting and common intersection cases

Finding intersections near path segment endpoints was previously unreliable
because of imprecision, and the necessity of avoiding double counting any
intersections. And, because of snapping, intersections on the endpoints
of path segments are a common case.
This also improved the ray casting use case, which previously used a "fudge factor"
to mitigate the common problem of casting a ray into line endpoints.

* fixed warnings

* Fix properties deselect (#606)

* Fix properties panel deselect

* Fix arrow cursors on select tool

* Fix drag from UI to document causing mouse down

* Fix tests

* Cleanup

* cleanup messages

* Draw the outlines of shapes on hover and selection (#609)

* Add hover outline overlay

* Increase selection tolerance

* Increase weight

* Only check if top intersection is selected

* Outline selected paths

* Reduce outline weight

* Increase path tool outline thickness to match hover

* Update to use unreachable! instead of panic!

* Upgrade vue-cli to version 5 (#594)

* Upgrade to Vue CLI 5 (fails to compile)

* Upgrade versions with last few weeks of changes

* Updated to fork-ts-checker-webpack-plugin 7.2.3

* Remove package.json overrides in lieu of the fixed fork-ts-checker-webpack-plugin@6.5.1

* Fix svg importing

* Comments

* For debugging only: added infrastructureLogging to vue.config.js

* Now works on Windows, waiting on fork-ts-checker-webpack-plugin backport if possible

* Switch to the fixed fork-ts-checker-webpack-plugin@6.5.2

* Fix license checker build compilation

Co-authored-by: 0hypercube <0hypercube@gmail.com>

* Tidy up the full frontend codebase and use optional chaining where possible (#620)

* Tidy up the full frontend codebase and use optional chaining where possible

* Code review changes

* Add a hotkey to select a random primary color (#622)

* Add shortcut to select a random primary color (#549)

* Rename random primary color message and reduce the number of calls to
generate_uuid

* Add documentation for SelectRandomPrimaryColor message

* Set the alpha value to 255 instead of a random value #622

Co-authored-by: Florent Collin <florentcollin23@gmail.com>

* Move the Layer Tree panel's New Folder and Delete icons into the options bar

* Migrate dialogs to Rust and add a New File dialog (#623)

* Migrate coming soon and about dialog to Rust

* Migrate confirm close and close all

* Migrate dialog error

* Improve keyboard navigation throughout UI

* Cleanup and fix panic dialog

* Reduce css spacing to better match old dialogs

* Add new document modal

* Fix crash when generating default name

* Populate rust about graphite data on startup

* Code review changes

* Move one more :focus CSS rule into App.vue

* Add a dialog message and move dialogs

* Split out keyboard input navigation from this branch

* Improvements including simplifying panic dialog code

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* 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>

* Add the File > Export dialog and PNG/JPG downloading (#629)

* Add export dialog

* Code review changes

* More code review feedback

* Fix compilation on stable Rust

* Fixes to problems

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Code review

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Oliver Davies <oliver@psyfer.io>
Co-authored-by: mfish33 <32677537+mfish33@users.noreply.github.com>
Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Co-authored-by: TrueDoctor <dennis@kobert.dev>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alaska <simon.wuelker@arcor.de>
Co-authored-by: 0hypercube <0hypercube@gmail.com>
Co-authored-by: FlorentCollin <florentcollinpro@gmail.com>
Co-authored-by: Florent Collin <florentcollin23@gmail.com>
2022-05-10 17:31:08 -07:00
Keavon Chambers
b24d280d81 Clean up website file structure 2022-05-10 11:35:39 -07:00
0HyperCube
060182fd31 Add the File > Export dialog and PNG/JPG downloading (#629)
* Add export dialog

* Code review changes

* More code review feedback

* Fix compilation on stable Rust

* Fixes to problems

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-05-09 07:35:22 +01:00
0HyperCube
e3e506ecfb 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>
2022-05-09 04:13:57 +01:00
0HyperCube
4b7d8b7ab0 Migrate dialogs to Rust and add a New File dialog (#623)
* Migrate coming soon and about dialog to Rust

* Migrate confirm close and close all

* Migrate dialog error

* Improve keyboard navigation throughout UI

* Cleanup and fix panic dialog

* Reduce css spacing to better match old dialogs

* Add new document modal

* Fix crash when generating default name

* Populate rust about graphite data on startup

* Code review changes

* Move one more :focus CSS rule into App.vue

* Add a dialog message and move dialogs

* Split out keyboard input navigation from this branch

* Improvements including simplifying panic dialog code

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-05-07 09:59:52 +01:00
Keavon Chambers
1a8cc9654a Move the Layer Tree panel's New Folder and Delete icons into the options bar 2022-05-06 12:44:38 -07:00
FlorentCollin
c65c33243b Add a hotkey to select a random primary color (#622)
* Add shortcut to select a random primary color (#549)

* Rename random primary color message and reduce the number of calls to
generate_uuid

* Add documentation for SelectRandomPrimaryColor message

* Set the alpha value to 255 instead of a random value #622

Co-authored-by: Florent Collin <florentcollin23@gmail.com>
2022-05-06 08:50:50 +02:00
Keavon Chambers
07736a9fca Tidy up the full frontend codebase and use optional chaining where possible (#620)
* Tidy up the full frontend codebase and use optional chaining where possible

* Code review changes
2022-04-30 02:52:53 -07:00
Keavon Chambers
92ee3bbad3 Upgrade vue-cli to version 5 (#594)
* Upgrade to Vue CLI 5 (fails to compile)

* Upgrade versions with last few weeks of changes

* Updated to fork-ts-checker-webpack-plugin 7.2.3

* Remove package.json overrides in lieu of the fixed fork-ts-checker-webpack-plugin@6.5.1

* Fix svg importing

* Comments

* For debugging only: added infrastructureLogging to vue.config.js

* Now works on Windows, waiting on fork-ts-checker-webpack-plugin backport if possible

* Switch to the fixed fork-ts-checker-webpack-plugin@6.5.2

* Fix license checker build compilation

Co-authored-by: 0hypercube <0hypercube@gmail.com>
2022-04-26 01:47:13 -07:00
0HyperCube
265cc0fe32 Draw the outlines of shapes on hover and selection (#609)
* Add hover outline overlay

* Increase selection tolerance

* Increase weight

* Only check if top intersection is selected

* Outline selected paths

* Reduce outline weight

* Increase path tool outline thickness to match hover
2022-04-24 01:21:48 +01:00
0HyperCube
ec43b7945e Fix properties deselect (#606)
* Fix properties panel deselect

* Fix arrow cursors on select tool

* Fix drag from UI to document causing mouse down

* Fix tests

* Cleanup
2022-04-22 10:58:29 +01:00
Keavon Chambers
f38289f036 Change stroke weight from ints to floats (#601)
Also rename stroke "width" to "weight" in some places. Closes #587

* Change stroke weight from ints to floats

* "miter_limit" -> "line_join_miter_limit"

* Bump file format version
2022-04-21 13:35:35 -07:00
0HyperCube
19d59ec6f4 Stop pointerdown event from properties panel (#600) 2022-04-21 21:14:11 +01:00