Commit Graph

761 Commits

Author SHA1 Message Date
Keavon Chambers
cc4bfd7e42 Fix compilation after upgrading TypeScript 2022-11-16 20:50:53 -08:00
Keavon Chambers
02d5b019a6 Update frontend node.js packages 2022-11-16 18:36:34 -08:00
Keavon Chambers
839a55179e Update bezier-rs interactive demos node.js packages 2022-11-16 18:31:21 -08:00
Keavon Chambers
f918745b73 Bump MSRV to 1.65.0 for let-else syntax
Closes #857
2022-11-16 18:04:13 -08:00
Rob Nadal
28f8802142 Bezier-rs: Convert to_svg used in subpaths to match style used in beziers (#854)
Converted subpath::to_svg to Bezier style
2022-11-14 22:37:06 -08:00
Keavon Chambers
71b98b0c21 Change Imaginate image creativity to a percentage 2022-11-12 14:36:12 -08:00
0HyperCube
d9177f5f4d Add a basic API and rudimentary frontend for node graph layers (#846)
* Node graph API stub

* Rename and fix SetInputValue

* Get list of links from network

* Test populating node graph UI

* Node properties

* Fix viewport bounds

* Slightly change promise usage

* A tiny bit of cleanup I did while reading code

* Cleanup and work towards hooking up node links in Vue template

* Add the brighten colour node

* Run cargo fmt

* Add to and from hsla

* GrayscaleImage node with small perf improvement

* Fix gutter panel resizing

* Display node links from backend

* Add support for connecting node links

* Use existing message

* Fix formatting error

* Add a (currently crashing) brighten node

* Replace brighten node with proto node implementation

* Add support for connecting node links

* Update watch dirs

* Add hue shift node

* Add create_node function to editor api

* Basic insert node UI

* Fix broken names

* Add log

* Fix positioning

* Set connector index to 0

* Add properties for Heu shift / brighten

* Allow deselecting nodes

* Redesign Properties panel collapsible sections

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2022-11-12 13:23:28 -08:00
Keavon Chambers
d75f0aa0ab Fix color picker alpha slider range 2022-11-12 09:11:25 -08:00
0HyperCube
4cda84521f Reduce history system's excessive memory usage from storing copies of images each step (#845)
* Limit saved undo history

* Do not commit path every mouse move event

* Reference count images in history system instead of cloning the image data

* Increase history storage step limit to 100

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-11 11:44:43 -08:00
0HyperCube
be353878d0 Fix disappearing path when it is closed with the Pen tool by drawing from its start point (#844) 2022-11-09 13:57:06 -08:00
Keavon Chambers
b1ee93313b Fix opacity slider range bug 2022-11-08 16:25:55 -08:00
Keavon Chambers
901a8652ec Update frontend and bezier-rs demo npm dependencies 2022-11-08 15:17:02 -08:00
Keavon Chambers
f5f89a650c Fix swapped boolean subtract modes 2022-11-08 01:09:51 -08:00
Keavon Chambers
0725f80049 Add new sampling methods to Imaginate 2022-11-07 00:37:17 -08:00
Rob Nadal
bb2dd5a259 Bezier-rs: Added curve outline functions (#789)
* Implement offset and reverse

Co-authored-by: Rob Nadal <robnadal44@gmail.com>

* Initial work on graduated outline

Co-authored-by: Rob Nadal <robnadal44@gmail.com>

* Handle linear case for graduated scale

* Added skewed outline, fixed graduated scale hourglass bug

* Removed test code

* Update comments

* Fix linting issue

* Improve comments

* Comment fixes

Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-06 21:25:00 -08:00
Hannah Li
b7ed54a336 Bezier-rs: Add a pivot point to the 'rotate' function (#792)
* Add function to rotate around a point

* Update svg

* Improve rotation line-to-center styling

* Add second angle of lines

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-06 20:52:58 -08:00
Linda Zheng
02c4640aee Bezier-rs: Convert 'arcs' wasm function from canvas to SVG rendering (#833)
* Convert rotate demo to svg

* Fix bugs in rotate

* Fix bugs in rotate

* Draft of decasteljau to svg

* fixed de casteljau points to_svg impl

* clean up wasm impl for de casteljau points

* Use svg format in wasm for arcs

* Update app.vue

* Fix arcs as svg

Co-authored-by: Linda Zheng <ll2zheng@uwaterloo.ca>

* Remove comments

* Reduce code duplication

Co-authored-by: Thomas Cheng <contact.chengthomas@gmail.com>
Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-06 20:04:30 -08:00
Linda Zheng
0342b35f79 Bezier-rs: Convert 'rotate' and 'de casteljau' wasm functions from canvas to SVG rendering (#793)
* Convert rotate demo to svg

* Fix bugs in rotate

* Fix bugs in rotate

* Draft of decasteljau to svg

* fixed de casteljau points to_svg impl

* clean up wasm impl for de casteljau points

* Address Hannah's comments

* Nits

Co-authored-by: Thomas Cheng <contact.chengthomas@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-06 18:34:53 -08:00
Jackie Chen
0e8ea262e4 Bezier-rs: Convert intersection functions to SVG (#791)
* Break handle of path being drawn by placing anchor on previous anchor with Pen tool (#814)

* Break path by placing anchor on previous one

* Fix offset on click without dragging

* Fix bug where ids reassigned from saved document

* Fix stuck overlay

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

* convert intersection functions to svg

* fixed nits

Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-06 18:14:44 -08:00
Keavon Chambers
4622273b09 Change favicon/app manifest theme color to white 2022-11-06 01:55:48 -07:00
Keavon Chambers
9e5626ced6 Fix several CSS compatibility issues in Safari (#841)
* Fix button margin default for Safari compatibility

* Add Safari vendor prefixes that are somehow still necessary

* Add workaround for Safari not rendering text selection

* Replace <h3> and <p> placeholder labels in floating menus with <TextLabel>

* Replace <span> elements with <TextLabel> and set its cursor for Safari
2022-11-06 00:50:45 -07:00
Keavon Chambers
265f11a751 Add rotation custom cursor icon for the transform cage 2022-11-05 23:02:21 -07:00
Keavon Chambers
6031f4cffd Add the range slider design to the NumberInput widget (#839)
* Add range slider to NumberInput

* Cleanup

* Fix event ordering causing bug in Firefox

* Polish the code

* Switch number input modes to range in relevant places
2022-11-05 22:57:19 -07:00
0HyperCube
9cdebfb1f0 Integrate the node graph as a Node Graph Frame layer type (#812)
* Add node graph frame tool

* Add a brighten

* Use the node graph

* Fix topological_sort

* Update UI

* Add icons for the tool and layer type

* Avoid serde & use bitmaps to improve performance

* Allow serialising a node graph

* Fix missing ..Default::default()

* Fix incorrect comments

* Cache node graph output image

* Suppress no-cycle import warning

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-05 14:38:14 -07:00
0HyperCube
596b9f4531 Add control over gradient stops (#834)
* Add gradient stops

* Better step adding

* Steps can be dragged past each other

* Swapping and switching gradient/fill

* Fix convert to gradient

* Skip non finite transforms for overlays

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-05 06:30:48 -07:00
Keavon Chambers
71680ab005 Add suffix widget non-rounding; add disabled state to many widgets 2022-11-04 17:09:03 -07:00
Keavon Chambers
afc84d30f8 Revamp UI styling to remove accent color; improve tab navigation 2022-11-04 05:56:33 -07:00
Keavon Chambers
69fd3dfc35 Move browser incompatibility check outside the JS bundle 2022-11-03 03:06:16 -07:00
Keavon Chambers
70b03ec886 Update the Imaginate image generation API (#836)
* Update the Imaginate feature server API

* Change connection status strategy to prevent console errors

* Possible CORS fix? Maybe revert.

* Update to the final API and fix bugs
2022-11-03 03:06:14 -07:00
Keavon Chambers
7522af9fc7 Refactor persistent data storage code and add button to wipe data on crash (#827)
* Organize persistence.ts

* Switch to simpler promise handling

* Switch document list storage from localStorage to IndexedDB

* Track document auto-save status to avoid re-auto-saving unnecessarily

* Add button to clear storage on crash

* Bump document version and test file

* Switch to IDB-Keyval instead of raw IDB transactions
2022-11-03 03:05:41 -07:00
Keavon Chambers
d6c2d73f45 Reenable optimizations in debug mode which were inadvertently disabled 2022-11-02 00:42:44 -07:00
Keavon Chambers
df1b25f42e Remove regex lookbehind in rasterization which is unsupported by Safari 2022-11-02 00:26:39 -07:00
Keavon Chambers
7d2bdf11e1 Revamp the ColorPicker popover and ColorInput widget (#830)
* Add cancel hint to Eyedropper tool

* Improve eyedropper overlay CSS

* Make CSS for transparent checkered background reusable

* Add color choice preview to color picker

* Draw text and markers as contrasting white or black

* Add reactive color updating and new/initial swapping

* Add Hex, RGB, HSV, and Opacity inputs

* Add none color and preset buttons

* Add eyedropper button and fix alignment (now visually done)

* Wire up none colors through the backend and style the ColorInput widget

* Add color info chip to ColorInput widget

* Fix all UX bugs

* Add more tooltips

* Fix FloatingMenu recursive loop

* Prevent mouse stray from closing color picker while dragging pickers

Closes #703

* Fix deselect all layers shortcut

* Add temporary eyedropper for Chromium browsers and a coming soon fallback
2022-10-28 18:36:04 -07:00
0HyperCube
803fa4a045 Better checks for invalid transforms in the transform cage (#831)
* Better checks for invalid transform

* Fix resize cursor

* Do not allow resizing with no width/height

* Fix pivots for 0 width/height layers
2022-10-26 16:14:32 -07:00
Keavon Chambers
5f1501aad3 Improve floating menu hover transfer behavior (#829) 2022-10-26 02:39:08 -07:00
TrueDoctor
52048cb0d2 Implement Upcasting without nightly support (#825) 2022-10-25 16:37:18 -07:00
TrueDoctor
a65ac7ddfd Node graph dynamic execution (#824)
Restructure document node implementation

* Implement topological sort

* Enforce the usage of type annotations

* Add complete test case
2022-10-25 15:45:42 -07:00
0hypercube
1a4a0db7e8 Add some raster protonodes 2022-10-26 00:37:05 +02:00
TrueDoctor
2873c8fb00 Relax borrow stack lifetimes (#823)
Relax lifetimes for borrow_stack
2022-10-25 15:35:30 -07:00
TrueDoctor
097899611f Implement node registry (#822) 2022-10-25 15:32:50 -07:00
Keavon Chambers
3fe552ff20 Fix image flickering while Imaginate layers generate 2022-10-24 20:40:06 -07:00
Keavon Chambers
24cfa6a5ad Clean up Vue component refs (#813)
* Clean up Vue component refs

* Second pass of code improvements
2022-10-24 20:02:49 -07:00
0HyperCube
d44e7ff925 Break handle of path being drawn by placing anchor on previous anchor with Pen tool (#814)
* Break path by placing anchor on previous one

* Fix offset on click without dragging

* Fix bug where ids reassigned from saved document

* Fix stuck overlay

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-10-24 19:35:48 -07:00
0HyperCube
74b2737f1f Double click to toggle sharpness of an anchor's handles with the Path tool (#815)
* Double click to flip sharpness of anchor's handles

* Fix bad length

* Convert mirror distance to toggle

* Revert "Convert mirror distance to toggle"

This reverts commit 76b5650022.

* Fix mirror_distance_between_handles being inverted
2022-10-24 21:55:31 +01:00
Keavon Chambers
0b9c45c9e8 Refactor color picker floating menu (#809)
* Move FloatingMenu template component

* Rewrite the ColorPicker component so it's not horrifically bad code

* Move FloatingMenu into the ColorPicker component

* Little Imaginate fixes

* Add todo
2022-10-23 17:29:04 -07:00
0HyperCube
a9d787bb49 Fix image export bounds calculation for selected layers (#807)
* Fix Export Bounds

* Fix the scale of the transform
2022-10-22 14:48:38 -07:00
0HyperCube
55deba1ccc Allow Imaginate layers to work with rotation and skew (#806)
* Fix AI layer rotation

* Transform things by matricies

* Clean up size calculation

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-10-22 20:01:38 +01:00
Kit PANG
66ef679e58 Disallow zero-area artboards (#794)
* Fix zero-area artboard

* Add artboard only when user starts dragging

* Rename variables for clarity

* Revert regression caused by commit a11c9ef6ef

* Fix zero-area artboard properly
2022-10-22 09:14:37 -07:00
Keavon Chambers
4023491792 Improve visibility of Eyedropper widget on dark backgrounds (closes #802) 2022-10-21 16:43:32 -07:00
Keavon Chambers
f2db20f061 Remake Eyedropper tool to sample pixel colors from viewport canvas (#801)
* Remake Eyedropper tool to sample pixel colors from viewport canvas

* Bug fixes

* Reorder export buttons

* Remove the larger primary/secondary ring

* Add aborting with Escape
2022-10-21 01:50:02 -07:00