Commit Graph

857 Commits

Author SHA1 Message Date
Hannah Li a328e7d3ef Bezier-rs: Add split for Subpath (#988)
* Add subpath split

* Update comment and colors

* Address comments

* Improve visualization clarity

* Code review

---------

Co-authored-by: Rob Nadal <Robnadal44@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-31 03:17:20 -05:00
Jackie Chen 511a8aa164 Bezier-rs: Add normal and tangent to subpath (#1003)
tangent and normal for subpath

Co-authored-by: Rob Nadal <Robnadal44@gmail.com>
2023-01-31 00:15:37 -05:00
Keavon Chambers beab0f01c6 Refactor font_cache into render_data; delete image layer type 2023-01-29 20:31:14 -08:00
Keavon Chambers 7ab601c0c6 Clean up arg order in process_message() so data is last 2023-01-29 04:07:41 -08:00
Keavon Chambers d990110f63 Apply lints and cleanup to Rust code 2023-01-29 03:01:57 -08:00
Brendan Allan 5388b59e97 Groundwork for integrating Specta (#949)
* add derive(specta::Type)

* use specta from git

* introduce Uuid type

* remove unnecessary specta::Type

* document export_types test

* upgrade Specta
The previous Specta branch had some hacks that were just for this project. They have all been converted into proper features so they can be merged into main.

* remove some unnecessary specta::Type uses

* add MessageDiscriminantDef explanation

* manually export types with specta

* rename 'specta.rs' to 'export_types.rs'

* rename 'export_types' to 'generate_ts_types'

---------

Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me>
2023-01-28 22:29:38 -08:00
kadir e0146d57f7 Update UI when deleting last point of shape with Path tool (#979)
* Added new DocumentResponse variant

* Update Operation::DeleteSelectedManipulatorPoints to update Layer Tree by delegating deletion to Operation::DeleteLayer. Also emits Operation::DeletedSelectedManipulatorPoints to let editor clear Properties panel

* Update process_message() to deal with new DocumentResponse::DeletedSelectedManipulatorPoints match case. When this DocumentResponse is emitted, it clears the Properties panel.

* Added Display trait implementation for DocumentResponse::DeletedSelectedManipulatorPoints. Updated imports in document_message_handler.rs to get the correct types for messages emitted from DocumentResponse::DeletedSelectedManipulatorPoints match case in process_message().

* Removed useless import. Capitalized comments for style consistency.

* Updated messages emitted to clear Properties panel by emitting LayoutMessage::SendLayout's instead, which update the backend widget state

* Revert inclusion of unused imports

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-28 18:32:31 -05:00
kadir 6676f16ea8 Auto switch to Select tool after importing an image (#994)
Forced user tool to be Select Tool after importing image.

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-28 05:35:02 -05:00
0HyperCube 0a03aec343 Reduce tool code duplication and boilerplate (#993)
* Reduce tool code duplication

* Add doc comments

* Fix Mac key variant, which can't be auto-converted without false positives

* Rename "key" to "keys"

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-28 08:38:52 +00:00
Dennis Kobert 0531df18d5 Implement blur as a document node (#987)
* Implement blur as a document node

* Reuse node node registry

* Add comment explaining the use of once cell

* Fix rebase error
2023-01-27 21:47:47 +01:00
0HyperCube 898b0bb582 Cull snapping of points outside viewport (#961)
Do not snap to points outside viewport

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-27 20:28:12 +00:00
0HyperCube 64e62699fc Replace the image layer type with an Image node (#948)
* Use builder pattern for widgets

* Arguments to new function

* Add node graph when dragging in image

* Fix duplicate import

* Skip processing under node graph frame if unused

* Reduce node graph rerenders

* DUPLICATE ALL frontend changes into other frontend

* DUPLICATE more changes to another frontend

* Code review

* Allow importing SVG files as bitmaps

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-27 10:01:09 +00:00
Keavon Chambers 66e8325362 Update project readme and MSRV 2023-01-24 01:33:30 -08:00
0HyperCube 5cbe3f7573 Artboard history (#976)
* Convert DocumentSave to struct

* Comit the artboard history save in some cases

* Cause index out of bounds error

* Use box to avoid weird wasm error

* Implement the artboard history

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-22 19:51:08 +00:00
Keavon Chambers d2219cec36 Fix website RSS feed title 2023-01-22 00:59:26 -08:00
Keavon Chambers 05425e39ec Svelte: fix pre-init error check and Properties panel 2023-01-18 22:55:39 -08:00
Keavon Chambers fb10e5194e Svelte: Fix calling DOM API functions on the actual elements 2023-01-13 17:17:38 -08:00
Oliver Davies 0019340096 Remove additional boolean for mirroring distance (#965)
Removed the additional boolean for mirroring distance
2023-01-13 15:00:20 -08:00
Keavon Chambers bf1a3e3daf Clean up imports and warnings in Rust code 2023-01-13 12:45:14 -08:00
Dennis Kobert b030a1860b Add self hosted runner to ci.yml (#955)
* Add self hosted runner to ci.yml

* Remove libgtk install

* Use mold as the linker

* Make build logs non verbose

* Fix crash on failure to get GLOBAL_PLATFORM

* Copy the platform enum before calling unwrap_or_default

Co-authored-by: 0hypercube <0hypercube@gmail.com>
2023-01-13 21:32:50 +01:00
Keavon Chambers 5619d44300 Port frontend from Vue to Svelte (WIP in separate folder, many bugs) (#964)
* Make `tauri build` just work

* Move folder: frontend/wasm -> wasm

* Create SvelteKit project with 'npx create-svelte'

* Move wasm-communication into seperate npm package

* Use wasm-pack directly and pack package.json

* Got it to work

* Add primitive build script for wasm npm module

* Fix wasm build script (python)

* Clean up glue code

* Rewrite wasm build script in node.js

* Add serde-reflection to trace types

* Add traced types

* Generate typescript (.d.ts) from Rust types

* Update .d.ts

* Finalize TS types

* Add script to update .d.ts

* Add watch command to build wasm-bindgen

* Make wasm work again

* Add sass; fix build script for windows

* Describe requirement for wasm-pack

* Add license

* Copy and reorganize vue components

* translate LayoutCol.vue

* Split app.scss into pieces

* Translate LayoutRow.svelte

* Rename scss files

* Fix compile issues on Windows

* WIP port TitleBar

* Support classes for LayoutCol/Row

* Restructure based on Vue codebase

* Port all components in window folder

* Port FloatingMenu

* Port Document panel component

* Update readme after folder move

* Update typegen: print discriminant by default

* Update typegen: Merge from branch 'tailwind' 4f14fedb

Fixes bigint & bytes

* Made Vue/webpack/eslint to accept wasm package at new location

This is quite a hack.

Those two packages are both named the same. Yes, it's an npm package inside another npm package.

- frontend/src/wasm-communication/
- frontend-svelte/glue/

'wasm/pkg/index.js' imports the correct one registered when linking.

* Port LayerTree

* Port NodeGraph

* Port Properties

* Port components in /floating-menus

* Finish porting all Vue -> Svelte components

* Change import prefix

* Revert type generation

* Revert moved wasm folder

* Revert all of @locriacyber's work on this branch

- Remove Vite and restore Webpack
- Remove SvelteKit
- Remove everything except the components I ported to Svelte
- Restore all frontend files from Vue code, now altered for Svelte

* Convert Vue's 'reactive' and 'provide' to Svelte's stores and contexts

* Fix event emitting and bi-di data flow

* Undo removal of 'update:' events

* Fix 'update:' event dispatching

* Fix usage in parent of bi-di component props

* Fix component typing, more progress towards no errors

* The page builds and opens!

* Add loading spinner and remove postcss dependency

* Make the basics of document editing work

* Fix rebase history

Co-authored-by: Locria Cyber <74560659+locriacyber@users.noreply.github.com>
2023-01-13 01:05:20 -08:00
Rob Nadal 01853fe4b7 Bezier-rs: Refactor interactive demo to remove Vue (#959)
* Converted bezier example to vanilla js component

* Indent with tabs

* Add sliders

* Converted bezier example pane to vanilla js

* Implement the radio buttons + fixes

* Converted SubpathExample to vanilla js

* Converted SubpathExamplePane to vanilla js

* Removed vue components

* Remove App.vue

* Remove vue and other dependencies

* Minor fix in main.ts

* Added insert to subpath features

* Entry point tweaks

* Rename "example" to "demo"

* Kebab-case file names (except classes)

Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-13 04:04:39 -05:00
Hannah Li 758f757783 Bezier-rs: Insert function for subpath (#876)
* Add manipulator

* Add manipulator group

* Add UI

* Address comments and rebase

* Renamed add_manipulator_group to insert

Co-authored-by: Rob Nadal <robnadal44@gmail.com>
2023-01-12 18:26:25 -08:00
0HyperCube cd58dcd3dd Pen tool redraw overlays on selection change (#960)
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-12 21:55:08 +00:00
Dennis Kobert 329f0be6b2 Update package chache before install (#962) 2023-01-12 09:43:50 +01:00
kadir 720cbaf754 Fix hints not closing when all documents are closed (#954)
* Fixes issue of hints not closing when all documents are closed

* Fix whitespace and rewrite comment

* Close tool hints when you close all documents by doing File->Close All
2023-01-10 04:20:06 -05:00
0HyperCube 741e61a59d Hide handle overlays too close to the parent anchor (#951)
Hide handle overlay

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-09 03:32:26 +00:00
0HyperCube 2a27471363 Fix boolean crash with self intersecting shape (#952) 2023-01-09 02:25:06 +00:00
0HyperCube de407f8b23 Use builder pattern for widgets (#941)
* Use builder pattern for widgets

* Arguments to new function
2023-01-08 14:34:24 +00:00
locriacyber 1a6ee7c542 Remove direct dependency on ttf_parser (#947)
Because ttf_parser updated, rustybuzz was using an older version.
2023-01-07 16:40:59 +00:00
0hypercube 8e9d097fcc Fix accidental 'not' when checking for redraw 2023-01-03 18:24:02 +00:00
0HyperCube cd8a897b96 Don't show the blue outline when bloburl is set (#937) 2023-01-03 10:05:46 +00:00
Keavon Chambers 5ca6b3fafa Fix build scripts so a failure returns a nonzero exit code 2023-01-02 22:04:13 -08:00
Dennis Kobert de5d02da00 Manually install packages instead of using github action (#943)
Fixes the fact that CI randomly stopped working on existing code in master that already passed CI
2023-01-03 10:04:42 +01:00
0HyperCube 7cc1a192cb Fix viewport culling with nested layers (#939)
* Fix viewport culling with nested layers

* Clean up naming
2023-01-02 15:27:11 +00:00
0HyperCube df44e8d978 Fix dragging nodes (#936) 2023-01-02 14:38:43 +00:00
0HyperCube 2bcc3d3baf Improve history states (#932)
* Add some more history states

* Fix undo whilst drawing

* Paste image history

* Toggle output and preview history

* Code review nits

* Remove extra '{'

* Fix typo

* Fix about.toml

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-01 22:02:44 +00:00
0HyperCube 6e142627a3 Fix a derivative causing NaNs in boolean ops (#934)
* Fix a derivative causing NaNs

* Better error messages around boolean ops

* Tweak error dialog wording

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-01 08:54:10 +00:00
Dennis Kobert a9601ab164 Implement the Gaussian Blur node (#933) 2022-12-31 21:12:02 +01:00
Dennis Kobert 74bfd630a9 Quantization node (#887)
Add basic quantization node
2022-12-31 18:30:35 +01:00
Dennis Kobert 79ad3e7908 Restructure GPU compilation execution pipeline (#903)
* Restructure gpu compilation execution pipeline

* Add compilation server/client infrastructure

* Add wgpu executor
2022-12-31 02:52:04 +01:00
mfish33 be32f7949f Ability to debounce inputs going to the backend (#913)
added debouncer to slow updates to the backend

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-30 17:30:47 -05:00
Rob Nadal 72cd204c64 Bezier-rs: Add project function for Subpaths (#914)
* Added subpath project function

* Set appropriate project default in single manipulator group case

* Lint

* Return optional from subpath project + stylistic changes per review

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-29 18:32:22 -05:00
0HyperCube 0d703e857b Gradient tool improvements (#927)
* Reuse existing gradient

* Double click to insert gradient stop

* Add history states to the gradient tool

* Do trig in viewport space so it is actually perpendicular

* Sync tool options with active gradient

* Deleting points with delete key

* More tolerance on inserting points
2022-12-29 20:00:58 +00:00
0HyperCube 69293964c4 Fix setting the position and rotation in the Properties panel (#928)
Fix setting the position and rotation in the properties panel
2022-12-29 11:29:06 +00:00
0HyperCube 750ef06cba Add a 'Preserve Aspect Ratio' checkbox to Properties panel (#923)
* Add the link button

* Transform around pivot

* Remove log

* Fix tests

* Add a hacky two-line layout for the checkbox

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-28 23:21:03 +00:00
0HyperCube 87e550de17 Only open the node graph panel after drawing a new frame to avoid layout shift interruption (#924)
* Store drag start as document position

* Don't open graph whilst drawing

* Rename to is_drawing_node_graph_frame

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-28 21:07:10 +00:00
0HyperCube dbd6a032f7 Add a button to refresh the input (#926)
* Add a button to refresh the input

* Align left of refresh button

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-28 21:02:03 +00:00
0HyperCube af7779769a Fix stuck outline overlay (#925)
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-28 20:21:13 +00:00
0HyperCube 3bce11edb5 Allow the user to force clear any stuck overlays (#922)
Force clear overlays

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-28 20:19:50 +00:00