Commit graph

48 commits

Author SHA1 Message Date
Keavon Chambers
0037f5158c Add new icons to all menu bar entries 2025-02-07 19:08:06 -08:00
Nitish Choudhary
66357540bb
Add max width/height to text layers and draggable text boxes to the Text tool (#2118)
* Make progress in text tool

* Add line_width to gcore and gstd

* minor fix

* Dragging sets line_width correctly

* Get draw overlay to work

* Typo fix

* Make progress in text tool

* Add line_width to gcore and gstd

* minor fix

* Dragging sets line_width correctly

* Get draw overlay to work

* Typo fix

* Improve text bounding box

* Add toggle for editing line width

* Take absolute value of drag

* Fix optional properties

* Code review

* Attempt to add box height and abort with keys

* Attempt to add key modifiers and snap manager

* Use resize for improved dragging

* Refactor typesetting configuration into a struct

* Fix missing px unit in frontend

* Remove lines on rendered text

* Fix backwards compatibility

* Refactor lenient slection as an associate function in tool data

* Add dashed quad to text nodes

* Use correct names for max height and width

* Additional renames and reorder

* ReResolve conflict

* Code review and improvements

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-31 20:50:47 -08:00
James Lindsay
fc0cf604df
Update some dependencies (#2134)
* Update some dependencies

* Update to action v2

* Fix for v2
2024-12-12 18:28:49 +00:00
James Lindsay
dd4a97b09f
Correctly apply transforms to vector data and strokes (#1977)
* Fix adding a layer to a transformed group

* Fix assorted transform issues

* Default stroke transform

* Fix bench

* Transform gradient

* Gradient fix

* Add gradient reversal buttons to Fill node in the Properties panel

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-15 22:26:11 +00:00
adamgerhant
9adc640f19
Improve layer positioning in graph upon reordering; improve history system; add selection history (#1945)
* Improve layer positioning

* Collapse space when deleting

* Improve moving layers in layer panel

* Improved transactions

* Selection history

* Code review

* Select previous selection when aborting

* Fix crash and artboard select

* Add mouse forward/back button selection history bindings

Code review

* Menu buttons

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-01 02:34:18 -07:00
Keavon Chambers
857bc772de Fix Rust-Analyzer conflicts with build targets and other compile speed issues 2024-07-15 15:55:04 -07:00
adamgerhant
8d83fa7079
Generalize layers as merge nodes to enable adjustment layers (#1712)
* WIP, backward traversal issues

* Fix some tool issues

* Remove debugging

* Change some indices

* WIP: new artboard node

* WIP: add artboard node

* WIP: Artboard node and create_artboard

* WIP: Artboard node implementation complete

* WIP: Artboards input for output node

* Complete Artboard node

* Generalize LayerNodeIdentifier,  monitor_nodes support for Artboard node, adjust ResizeArtboard/ClearArtboards, move alias validation to Rust

* Fix misaligned artboard click targets

* Generalize/clarify create_layer and insert_between

* non-negative dimensions for resize_artboard

* Show artboards in layer panel

* Generalize create_layer for layer output node

* Generalize delete_layer/delete_artboard to NodeGraphMessage::DeleteNodes. Fixed upstream flow Iter

* remove old primary_input function

* Vertical node visuals, remove is_layer function, rename Layer node to Merge node, toggle display as layer

exposed_value_count type fix

Vertical node visuals, remove is_layer function, rename Layer node to Merge node, toggle display as layer

* Fix demo artwork

* Layer display context menu

* Automatically select artboard, fix warnings

* Improvements to context menu and layer invariant enforcement

* Remove display_as_layer and update load_structure

* Improve load_structure to show more layers, improve FlowIter, improve layer naming, layer rearrangement validation.

* Clean up demo artwork using generalized layers

* Improve design of Layers panel and graph nodes

* MoveSelectedLayersTo rewrite to support generalized layer nodes

* Include artboards in deepest_common_ancestor, fix resize_artboard/delete_artboard, sync artboard tool to layer panel

* MoveSelectedLayersTo adjustments

* Sync non layer node visibility with metadata

* Include non layer nodes when moving/creating layer

* Fix group layers and get_post_node_with_index

* Include non layer nodes in UngroupSelectedLayers

* GroupSelected for all selected nodes, UnGroupSelected position adjustments

* Add grouping for layers in different folders

* Fix hidden layers

* Prevent node from connecting to itself, fix undo automatic node insertion,

* Fix undo CreateEmptyFolder, fix grouping nested layer nodes

* Formatting

* Remove test and check if node is layer from network

* Fix undo group layers

* Check off roadmap

* MoveUpstreamSiblingsToChild adjustments

* Replace tabs with spaces, remove mut from argument

* Final code review pass

---------

Co-authored-by: 0hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-04-30 23:03:42 -07:00
Keavon Chambers
99c199a8f6 Add dev container configuration 2024-01-24 23:04:00 +00:00
Keavon Chambers
d268afb7fb Fix Bezier-rs interactive demos and migrate its Webpack bundler to Vite 2024-01-04 23:13:40 -08:00
Keavon Chambers
4d9e76063d Update website for the unified document graph release
Closes #1394
2023-12-14 05:01:54 -08:00
Keavon Chambers
60a9c27bf1
Add viewing/editing layer names, add Blend Mode node, and clean up Layer node (#1489) 2023-12-07 15:10:47 -08:00
Keavon Chambers
a6ca43bb2d
Restore ESLint and Prettier auto-formatting and CI linting (#1457)
* Restore ESLint and Prettier autoformatting

* Fix formatting and lints in web files

* Hacky fix to eslint crash

* Fix remaining lints

* Add lint-fix script

---------

Co-authored-by: 0hypercube <0hypercube@gmail.com>
2023-11-16 13:12:47 -08:00
Keavon Chambers
a871ea6d69 Add auto deployment infrastructure for website 2023-08-16 12:58:42 -07:00
Keavon Chambers
74d761dc84 Remove all references to Vue 2023-03-10 04:02:02 -08:00
Keavon Chambers
2327524690 Move JS script to the top of each Vue file 2023-03-10 03:44:49 -08:00
Keavon Chambers
97b461377f Fix error spam from Rust-Analyzer due to build scripts 2023-02-03 13:00:55 -08: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
Keavon Chambers
4412b983cd Move bezier-rs into libraries folder and deploy its interactive docs 2022-08-14 16:17:27 -07:00
Keavon Chambers
9e34199ca9 Additional cleanup of prelude imports in editor codebase
Closes #744
2022-08-05 17:09:37 -07:00
Oliver Davies
58675eb64d Refactor internal shape and reduce reliance on Kurbo (#617)
* Dissolve Points from path

* Add handling for removing the first anchor

* Add function to turn handles into bez_paths

* Created overlay manager, wip

* WIP Refactor of VectorShape / Overlays / ShapeEditor

* WIP stripping vector shape, anchor, point.

* WIP Removed kurbo deps from vector shape, anchor, point

* WIP Further work to make vector shapes / anchors / points more standalone.

* WIP more pruning

* WIP Progress on overlay_renderer

* WIP more overlay_renderer work

* WIP more pruning, cleared warnings

* WIP decided ShapeRenderer wasn't an accurate name, ShapeAdapter now. Error squashing continues.

* WIP squashed more errors, now need to decide if anchors should have unique IDs

* WIP Errors squashed, now to actually make it work.

* WIP Moved vector structs to graphene, beginning to remove bezpath from shape_layer

* Refactoring: disentangle kurbo from apply_affine

* Refactor internal shape and remove reliance on Kurbo (PR #617) - Disentangle Kurbo (#619)

* Refactoring: disentangle kurbo from apply_affine

* Broke boolean operations, refactor in state which compiles

* "fixed" boolean operation refactor related errors

* fixed apply_affine, which would not have applied any type of affine

* Small Cleanup, readability

* Fix issue with overlay styles no longer showing selection state.

* Resolved error with point option

* WIP, figuring out how to have one source of truth for VectorShape. Trying to avoid cloning.

* WIP work on single source of truth vectorshapes

* More steps toward single source of truth VectorShape

* Continued wip on making VectorShapes mutably accessible without cloning

* Wip using paths to reference vectorshapes instead, need to restructure ShapeEditor

* Decided to allow temporary copies of vectorshapes.

* Removed HashSet for selected shape indices

* Added @TrueDoctor's id_storage.rs with some heavy modification. Added it to VectorShape. Isn't yet used for folders.

* Integrated UniqueElements<T> with VectorShape to store VectorAnchors

* Improved storage_id.rs perf and cleaned up it's interface

* Iterator Implementations and fixes (#637)

* Refactoring: disentangle kurbo from apply_affine

* Broke boolean operations, refactor in state which compiles

* "fixed" boolean operation refactor related errors

* fixed apply_affine, which would not have applied any type of affine

* implemented transforms for VectorAnchors
implemented Not for VectorControlPointType

* started adding Vector Shape implementations of shape prototypes

* added several useful implemtations to UniqueElements

* added another implemnation for UniqueElements to make working with iterators easier, fixed vector-shape errors

* package-lock.json

* clean up rebase, added back Layer paths

* added deref implementation for VectorShape

* unnecesary variable

* simplify code by removing levels of indirection

* fixed errors

* merge cleanup

* removed package-lock.json

* Removed .selected from VectorShape, it isn't needed as layers are selected not shapes specifically.

* Removed transform and layer_path from VectorShape

* Auto-saving tentitively working. Work toward Overlay transform issues.

* Overlays properly hiding and caching. Not clearing cache yet and some tool switching issues remain, but progress.

* Putting layers in folders changes their unique ID. This is problematic. Assumed this was not the case.

* Removed need for closed bool, changed VectorShape to a tuple struct.

* WIP Switched to layer paths as opposed to VectorShapes. Next up add messages for changing VectorShapes.

* Added initial messages to edit VectorShape points.

* DeleteSelectedPoints messages implemented, selection isn't working currently though.

* Selection messages arriving in document, but transform is wrong.

* Selection, Deselection working, delete working for first point.

* Working towards moving points again

* Removed extra vec from UniqueElements, attempting to squash ordering bug. Still appears to occur though.

* Delete more stable, clean up, renamed to HandleIn, HandleOut

* Further vec_unique cleanup

* Further cleanup

* Removed Deref / DerefMut from VectorShape

* Document version++, will likely revert before merge into master

* Seleting / deleting handles tentitively working again.

* Version number bump, fixed tests.

* Fixed comment in VecUnique

* Improved VecUnique descriptor comment

* Renamed VecUnique to IdBackedVec to further clarify usage.

* Resolved formatting.

* WIP Fixing dragging points

* Fixed an instance where an OverlayMessage could be sent to the main document incorrectly.

* Deleting all of a shapes points now gracefully deletes the layer instead of crashing.

* Fixed handle configurations that would panic on deletion

* Single anchor dragging restored with multi-dragging next plus handles

* sides.into()

* Handle and Multi-point dragging working

* WIP Handle symmetry working again

* Handle mirroring functional again.

* Cleaned up warnings

* Fixed overlay outline not matching shape

* Git branch fix of compatibility with new master

* Fixed closed shape bug, replaced kurbo ellipse

* Removed unused func, updated comments

* Deleting points can undo, multiple shape selection deletes now working

* Removed AddOverlay* operations

* Partial fix for select drift, added helpers

* Don't snap against dragging points

* Properly cleanup path outline with multiple shapes

* Clear all points in other selected shapes

* Actually don't snap against dragging points

* Fix path tool & add snap angle and break handle

* Fix handle being set to NaN causing render issues

* Fix cached overlays not showing line -> curve

* Add operations for modifying paths

* Remove kurbo from pen tool

* Do not snap against handles when anchor selected

* Fix overlays not being cleaned up on path tool

* Fix handle position after dragging

* Use `Anchor` for text & no kurbo in operations

* Replace kurbo to_svg function

* Ngon no longer center scales by default, still some weird behaviour when holding alt

* Cleanup overlays

* Fix render and bounding box doctests

* Fix fun to_svg error

* Fix compile error

* Some code review

* Remove legacy `SelectPoint` on doubleclick

* Remove font from test document

* Fix the pen tool selection changed

* Reorder imports

Co-authored-by: Dennis <dennis@kobert.dev>
Co-authored-by: Caleb Dennis <caleb.dennis429@gmail.com>
Co-authored-by: caleb <56044292+caleb-ad@users.noreply.github.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: 0hypercube <0hypercube@gmail.com>
Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
2022-07-05 15:02:18 -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
d5b43ef2da Add frontend file structure docs and some related cleanup 2022-05-23 19:13:51 -07: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
5571f39b41 Update list of recommended VS Code extensions 2022-05-10 20:39:58 -07:00
Keavon Chambers
e101d4524d Switch VS Code's Vue extension from Vetur to Volar 2022-01-12 05:17:56 -08:00
Keavon Chambers
5b3cbb30fc Fix all clippy lint errors 2021-12-30 23:05:54 -08:00
Keavon Chambers
3dea989a00 New overlay system that reimplements how overlays are drawn (#418)
* New overlay system that reimplements how overlays are drawn

* Fix overlay message declaration

* Fix small mistake

* WIP (broken) changes to plumb the overlay document

* Fix confusion over messaging system architecture

* Removed log

* Overlay system working

* (broken) WIP overlay association

* Finish the overlay system (except test failure)

* Change back IDs in test

* Fixed test, but stilled fails due to revealed real problem with layer reordering selection

* Disable broken test that has a bug in issue #444

Co-authored-by: Dennis <dennis@kobert.dev>
Co-authored-by: otdavies <oliver@psyfer.io>
2021-12-30 09:48:39 -08:00
Keavon Chambers
d2395b4dcf Improve web infrastructure
Upgrade npm packages that were locked to old versions due to now-resolved problems
Remove unused/unnecessary dependencies and their configurations
Fix VS Code format on save
Fix VS Code removing EOF newline in JSON files in conflict with npm
Remove JSON files from ESLint because it doesn't properly support JSON
Add detailed comments to web-related configuration files
2021-08-26 19:20:38 -07:00
Keavon Chambers
53ad105f57 Restructure project directories (#333)
`/client/web` -> `/frontend`
`/client/cli` -> *delete for now*
`/client/native` -> *delete for now*
`/core/editor` -> `/editor`
`/core/document` -> `/graphene`
`/core/renderer` -> `/charcoal`
`/core/proc-macro` -> `/proc-macros` *(now plural)*
2021-08-07 05:17:18 -07:00
Keavon Chambers
c663b160e6 Fix inconsistent whitespace 2021-07-23 17:48:39 -07:00
bjorn3
9ed1fccd1d Two improvements to the development workflow (#270)
* Configure rust-analyzer to target wasm32-unknown-unknown

* Watch changes to core rust files
2021-07-16 10:49:52 +02:00
Simon Desloges
2d2954d045 Implement Select All/Deselect All layers (#242)
* Implement select all layers shortcut

* Adjust menu entry for Select All Layers

* Avoid selecting the root of the document when selecting all layers

* Implement deselect all layers

* Fix formatting

* Add extensions.json so VS Code recommends useful extensions

* Add rust-analyzer as the default Rust formatter
2021-07-10 20:01:37 -04:00
Keavon Chambers
29a2b46684 Add the checkbox input widget (#204)
* Add the checkbox input widget

* Add OptionalInput widget
2021-07-08 14:10:30 -07:00
Paul Kupper
12b373f1ab Don't use ESLint formatter for Rust files in VS Code (#228)
* Remove default formatter from vscode settings

* Only use eslint formatter on js/ts/json/vue files
2021-07-04 22:29:50 +02:00
Keavon Chambers
0ca4b9fe7c Fix web code linting to be portable across environments 2021-04-14 11:44:09 -07:00
Keavon Chambers
57540ed5ef Set CI environment variable to NODE_ENV=production during linting (#73) 2021-04-14 01:27:01 -07:00
ProTheory8
88b6703a02 Add .gitattributes file (#46)
Add .gitattributes and enforce the use of LF
2021-03-27 15:48:05 +05:00
Keavon Chambers
d9289573b4 Simplify rustfmt settings to remove using unstable rules 2021-03-24 13:37:00 -07:00
Keavon Chambers
f367f12ca2 Clean up component files by removing 'name' property 2021-02-20 17:59:23 -08:00
Keavon Chambers
b800e91ccd Change UI font to Source Sans Pro 2021-02-16 23:59:23 -08:00
Keavon Chambers
0a0628202f Add web frontend panel skeleton & Vue environment 2021-02-16 03:21:15 -08:00
Keavon Chambers
0578e8f7c7 Add WASM bindings and web project structure 2021-02-14 18:46:08 -08:00
Keavon Chambers
848228dd45 Add rustfmt.toml and enable auto formatting (Fixes #7) 2020-07-12 16:20:28 -07:00
Keavon Chambers
642c7ffd00 Switch shader texture usage from sampler2D to texture2D plus sampler (fixes #1) 2020-07-11 19:01:48 -07:00
Keavon Chambers
323a951362 Update wgpu from 0.4 to 0.5 (currently it's not rendering) 2020-05-02 14:44:28 -07:00
Keavon Chambers
b30ee294a6 Window with textured polygon 2020-04-26 00:28:13 -07:00