Commit Graph

740 Commits

Author SHA1 Message Date
Keavon Chambers 3f98d1c896 Add rotation custom cursor icon for the transform cage 2022-11-05 23:02:21 -07:00
Keavon Chambers 782f528279 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 18507b78ac 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 21:38:14 +00:00
0HyperCube 1462d2b662 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 13:30:48 +00:00
Keavon Chambers a1e061fa14 Add suffix widget non-rounding; add disabled state to many widgets 2022-11-04 15:03:22 -07:00
Keavon Chambers ff75e0eae9 Revamp UI styling to remove accent color; improve tab navigation 2022-11-04 05:56:33 -07:00
Keavon Chambers f7fd1d94eb Move browser incompatibility check outside the JS bundle 2022-11-02 18:01:38 -07:00
Keavon Chambers 5be59f7fce 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-02 17:20:29 -07:00
Keavon Chambers 9d56e86203 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-02 15:19:04 -07:00
Keavon Chambers 73233169b2 Reenable optimizations in debug mode which were inadvertently disabled 2022-11-02 00:42:36 -07:00
Keavon Chambers 5876c853d0 Remove regex lookbehind in rasterization which is unsupported by Safari 2022-11-02 00:26:39 -07:00
Keavon Chambers 85c635f92d 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 fa7116133b 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-27 00:14:32 +01:00
Keavon Chambers e4dc368ecc Improve floating menu hover transfer behavior (#829) 2022-10-26 02:39:08 -07:00
TrueDoctor ae7affda74 Implement Upcasting without nightly support (#825) 2022-10-26 01:37:18 +02:00
TrueDoctor 4ec600957c Node graph dynamic execution (#824)
Restructure document node implementation

* Implement topological sort

* Enforce the usage of type annotations

* Add complete test case
2022-10-26 00:45:42 +02:00
0hypercube d142a9092c Add some raster protonodes 2022-10-21 17:22:06 +01:00
TrueDoctor b2a90ddc2c Relax borrow stack lifetimes (#823)
Relax lifetimes for borrow_stack
2022-10-26 00:35:30 +02:00
TrueDoctor 11c6413251 Implement node registry (#822) 2022-10-26 00:32:50 +02:00
Keavon Chambers c3fbc4eac9 Fix image flickering while Imaginate layers generate 2022-10-24 20:40:06 -07:00
Keavon Chambers d2e23d6b15 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 cee1add3a4 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 23:11:04 +01:00
0HyperCube 0553cc5100 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 76b565002265feb29c899840c4b4696b80a220b2.

* Fix mirror_distance_between_handles being inverted
2022-10-24 21:55:31 +01:00
Keavon Chambers 7f9c59dd99 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 1219e26d17 Fix image export bounds calculation for selected layers (#807)
* Fix Export Bounds

* Fix the scale of the transform
2022-10-22 22:48:38 +01:00
0HyperCube 05169935ad 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 b10d7a93b6 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 a11c9ef6ef9c4daa35140148cec9ff85b3a3d8c8

* Fix zero-area artboard properly
2022-10-23 00:14:37 +08:00
Keavon Chambers 7b4c43ff8d Improve visibility of Eyedropper widget on dark backgrounds (closes #802) 2022-10-21 16:33:39 -07:00
Keavon Chambers 58a53a995d 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
Keavon Chambers fe1a03fac7 Integrate Stable Diffusion with the Imaginate layer (#784)
* Add AI Artist layer

* WIP add a button to download the rendered folder under an AI Artist layer

* Successfully download the correct image

* Break out image downloading JS into helper function

* Change file download from using data URLs to blob URLs

* WIP rasterize to blob

* Remove dimensions from AI Artist layer

* Successfully draw rasterized image on layer after calculation

* Working txt2img generation based on user prompt

* Add img2img and the main parameters

* Fix ability to rasterize multi-depth documents with blob URL images by switching them to base64

* Fix test

* Rasterize with artboard background color

* Allow aspect ratio stretch of AI Artist images

* Add automatic resolution choosing

* Add a terminate button, and make the lifecycle more robust

* Add negative prompt

* Add range bounds for parameter inputs

* Add seed

* Add tiling and restore faces

* Add server status check, server hostname customization, and resizing layer to fit AI Artist resolution

* Fix background color of infinite canvas rasterization

* Escape prompt text sent in the JSON

* Revoke blob URLs when cleared/replaced to reduce memory leak

* Fix welcome screen logo color

* Add PreferencesMessageHandler

* Add persistent storage of preferences

* Fix crash introduced in previous commit when moving mouse on page load

* Add tooltips to the AI Artist layer properties

* Integrate AI Artist tool into the raster section of the tool shelf

* Add a refresh button to the connection status

* Fix crash when generating and switching to a different document tab

* Add persistent image storage to AI Artist layers and fix duplication bugs

* Add a generate with random seed button

* Simplify and standardize message names

* Majorly improve robustness of networking code

* Fix race condition causing default server hostname to show disconnected when app loads with AI Artist layer selected (probably, not confirmed fixed)

* Clean up messages and function calls by changing arguments into structs

* Update API to more recent server commit

* Add support for picking the sampling method

* Add machinery for filtering selected layers with type

* Replace placeholder button icons

* Improve the random icon by tilting the dice

* Use selected_layers() instead of repeating that code

* Fix borrow error

* Change message flow in progress towards fixing #797

* Allow loading image on non-active document (fixes #797)

* Reduce code duplication with rasterization

* Add AI Artist tool and layer icons, and remove ugly node layer icon style

* Rename "AI Artist" codename to "Imaginate" feature name

Co-authored-by: otdavies <oliver@psyfer.io>
Co-authored-by: 0hypercube <0hypercube@gmail.com>
2022-10-18 22:33:27 -07:00
TrueDoctor 562217015d Rework DynAnyNode design to work with the borrow stack (#796) 2022-10-15 03:02:58 +02:00
0hypercube cef58b16c2 Some initial testing on dynamic nodes and composition
* Test use of borrow stack
2022-09-28 18:47:34 +01:00
TrueDoctor 2ced9a57c4 Implement the initial Document Nodes system (#795)
* Add testcase for flattening graph

* Implement equality for Values

* Implement input resolution
2022-10-15 02:02:50 +02:00
Keavon Chambers 0f0d30eb9a Add building instructions to the website contribute page 2022-10-14 10:09:37 -07:00
Brian Wo 02da804f38 Fix view mode affecting result of image export (#790) 2022-10-11 04:03:28 +08:00
Brian Wo 197ec492f2 Fix wrong hyperlink on website home page (#785)
Fix wrong url path in website
2022-10-09 06:44:04 +08:00
Keavon Chambers 35877a3fd9 Break apart and improve the JS for rasterizing SVGs and downloading files (#786)
It now uses a blob URL instead of a data URL in the download process, which is cleaner and better performance.
2022-10-08 11:34:31 -07:00
Thomas Cheng dccff784c5 Convert reduce() and offset() Bezier-rs wasm demo functions to render as SVG (#783)
* convert reduce and offset wasm func to return svg

* address comments
2022-10-05 23:54:02 -04:00
Hannah Li 55f6d13daf Bezier-rs: continue converting demos from canvas to SVG (#779)
* Convert constructor to use svg

* Convert the through_points functions to svg

* Convert length, lut, derivative, and tangent from canvas to svg

* Fixed bug when t1 == t2 in split

* Converted split and trim to use svg representation, and swapped slider options default to use quadratic options

* Convert normal and curvature to use svg representation in bezier-rs-demos

* Convert the project function to use svg representation in bezier-rs-demos

* Convert the local_extrema, bbox, and inflections to use svgs

* Add text offset constants

* Fix typo

Co-authored-by: Robert Nadal <Robnadal44@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-09-27 17:37:30 -07:00
Hannah Li e9cd792635 Bezier-rs: Convert from canvas to svg for constructors (#776)
* Convert constructor to use svg

* Convert the through_points functions to svg

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-09-26 19:14:27 -07:00
Keavon Chambers 8dce2144c4 Add website link prompting to subscribe to the newsletter 2022-09-25 01:45:59 -07:00
0HyperCube 914b940122 Fix image importing due to incorrect variable name (#781) 2022-09-23 18:53:03 +01:00
Keavon Chambers ab75f0fbfb Improve the website and readme with details and cleanup 2022-09-16 01:29:33 -07:00
Boutillier 54b63c3eb5 Fix crashes related to 0-scale shapes (#777)
* Fix crashes when dragging the bounding box/transform cage of a 0-scale shape.

* Fix crashes when dragging the pivot point of a 0-scale shape

* Fix rotation computation on DAffine2 when scale.x is 0, avoids Nan display

* remove remaining log::info that I introduced in earlier commit

* Fix crash when updating the scale of a transform that was already 0.

* Fix NumberInput behaviour when the requested value changed is does not happen.

* Fix rotation computation when Scale X and Scale Y are both 0. Display 0. This also fixes crashes when modifying the rotation in such case
2022-09-12 10:46:11 +02:00
0HyperCube 788552e10c #[macro_use] the log crate (#775) 2022-09-08 21:14:01 +01:00
Keavon Chambers 655831eedf Improve wording on the website home page; add a volunteer icon 2022-09-04 14:31:08 -07:00
Hannah Li f74b6ed111 Refactor bezier-rs' `to_svg` functionality (#758)
* Change Bezier to_svg to include handles and endpoints

* Move params into brackets of format macro, remove unused comment

* Use write macro instead of format

* Fix path for watched directory

* Refactor functions to remove ToSVGOptions
2022-09-01 23:13:39 -04:00
0HyperCube 1e109dc552 Add a pivot widget to selected layer(s) to control the origin(s) (#772)
* Add pivot

* Add dragging pivot

* Cleanup

* Remove tabs

* Fix multiplication order

* Restyle pivot

* Add move cursor icon

* Update pivot size

* Code review tweaks

* Fix alt with non-centred pivot

* Comment for add one

* Pivot sets layer panel origin

* Tweek alt centre thing

* Fix division by zero case

* Add pivot dots to properties

* FIx some typos

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-08-30 22:36:33 +01:00
Keavon Chambers 0f6f3be6e7 Add the Pivot Assist widget
Part of #525
2022-08-29 00:07:38 -07:00
0HyperCube 41c137ed1b Fix transformation cage centered-scaling to use the center as its pivot (#769)
* Add centre of transformation

* Add alt support

* New breaking file format version

* Spelling

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-08-29 01:30:45 +01:00