Commit Graph

168 Commits

Author SHA1 Message Date
Boutillier
74624bb531 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 01:46:11 -07:00
0HyperCube
131f24300a 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 14:36:33 -07:00
Keavon Chambers
1e723b8c86 Add the Pivot Assist widget
Part of #525
2022-08-29 00:08:01 -07:00
Keavon Chambers
8f59289c5d Remove usage of 'null' in favor of 'undefined' 2022-08-26 00:24:20 -07:00
Keavon Chambers
078cc4373f Enable some TS consistency lints 2022-08-26 00:24:10 -07:00
Keavon Chambers
33e790dc86 Prefix all type imports with the 'type' keyword where appropriate 2022-08-26 00:10:41 -07:00
Keavon Chambers
7848391f6e Clean up MenuList types and fix many Vue and Clippy warnings
Also remove hard-coded-in-Vue Graphite logo in the menu bar in favor of a Rust definition.
2022-08-26 00:10:41 -07:00
Keavon Chambers
5ad76bec6e Clean up camelCase and snake_case in frontend code 2022-08-26 00:10:15 -07:00
Keavon Chambers
44eb83c9b3 Fix logic bug in key internationalization for A-Z keys in alternate layouts 2022-08-14 13:57:01 -07:00
Keavon Chambers
776992a297 Simplify platform-specific keyboard layouts with Accel key and global platform variable (#748)
* Simplify platform-specific keyboard layouts with Accel key and global platform variable


Co-authored-by: Dennis <dennis@kobert.dev>
2022-08-13 13:28:02 +02:00
Keavon Chambers
d6e726f99d Fix shortcut label on welcome screen: "Control" -> "Ctrl" 2022-08-11 10:53:03 -07:00
Keavon Chambers
0f6ecefb3f Revamp key/code input processing which fixes Option key on Mac and other locales
Closes #742
Closes #746
2022-08-11 02:53:46 -07:00
Keavon Chambers
9f4a241e0f Extend welcome screen button click area to labels
Closes #738
2022-08-08 01:29:23 -07:00
luzpaz
5f5c3efdee Fix various typos (#745)
Found via `codespell -q 3 -L complies,crate,doubleclick,ist,ser,vew`
2022-08-05 20:57:52 -07:00
Keavon Chambers
52b3553a75 Add full support for Mac-specific keyboard layouts (#736)
* IPP for Mac, flawed initial experiments

* Cleanup and progress, but not compiling yet

* Fix error and rename nonmac -> standard

* Extentd ipp macros to accomodate mac input

* Add Mac versions of shortcuts; refactor and document the input mapper macros

* Change frontend styling for user input labels in floating menus

* Additional macro documentation

* A little more documentation

* Improve entry macro syntax

* Move input mapper macros to a separate file

* Adapt the keyboard shortcuts to the user's OS

* Display keyboard shortcuts in the menu bar based on OS

* Change Input Mapper macro syntax from {} to ()

* Fix esc key bug in Vue

* Tweaks

* Interim solution for Mac-specific hints

* Feed tooltip input hotkeys from their actions

* Fix hotkeys for tools because of missing actions

* Make Vue respect Ctrl/Cmd differences per platform

* Remove commented lines

* Code review pass by me

* Code review suggestions with TrueDoctor

* Turn FutureKeyMapping struct into ActionKeys enum which is a bit cleaner

* Add serde derive attributes for message discriminants

* Re-add serde deserialize

* Fix not mutating ActionKeys conversion; remove custom serializer

* Add serde to dev dependencies

Co-authored-by: Dennis <dennis@kobert.dev>
2022-08-03 14:13:43 -07:00
Keavon Chambers
f3bdf970f4 Implement File > Import and fix Ctrl+O to Open hotkey
Closes #671
2022-07-23 15:17:20 -07:00
Keavon Chambers
08a81002ff Hide canvas zoom widget automatically when zero 2022-07-22 23:09:45 -07:00
mfish33
010ba5a568 Welcome screen, refactor to allow zero documents, and add TS typing to widgets (#702)
* unfinished implementation

* Add frontend for the empty panel screen

* Add an icon for Folder based on NodeFolder

* fixed messages causing peicees of ui not to render on new document

* Standardize nextTick syntax

* WIP generisization of component subscriptions (not compiling yet)

* Fix crash when loading font and there is no active document

* Only advertise tool actions with a document

* Fix failure to create new document

* Initalise the properties panel

* Fix highlight tab, canvas jump, warns and layer tree

* Fix tests

* Possibly fix some things?

* Move WorkingColors layout definition to backend

* Standardize action macro formatting

* Provide typing for widgets in TS/Vue and associated cleanup

* Fix viewport positioning initialization

* Fix menu bar init at startup not document creation

* Fix no viewport bounds bug

* Change !=0 to >0

* Simplify the init system

Closes #656

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: 0hypercube <0hypercube@gmail.com>
2022-07-22 15:09:13 -07:00
0HyperCube
342d4b5f02 Fix IndexedDb in Firefox private browsing mode (#721)
* Fix db in firefox private

* Polished wording

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-07-09 15:23:49 -07:00
Keavon Chambers
4fa7a81f61 Fix broken BigInt64Array unsupported message on old Safari 2022-07-07 10:58:29 -07:00
0HyperCube
2191b09f9f Image and text bug fixes (#685)
* Image and text bugfixes

* Mark only the required layer types as dirty

* Fix doctest

* Disable selection if empty

* Cleanup naming

* Simplify cache deleting on export

* Minor css style change

* Nit

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-06-29 18:18:01 -07:00
Keavon Chambers
2052c00010 Fix DropdownInput repeated change emitting 2022-06-19 19:34:59 -07:00
Keavon Chambers
a443de8342 Implement the Edit > Paste menu entry (#683)
Closes #682
2022-06-19 00:53:33 -07:00
mfish33
537182df27 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 17:46:23 -07:00
Keavon Chambers
63fd5e87ab Change MenuList checkbox to be an icon from a widget 2022-06-17 17:55:04 -07:00
Keavon Chambers
04d6bd9190 Update npm dependencies (#678) 2022-06-13 12:32:01 -07:00
0HyperCube
55ef8eedb8 Fix Ctrl+Enter to commit text (#675) 2022-06-11 04:01:31 -07:00
0HyperCube
42dbed9315 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 15:21:10 -07:00
0HyperCube
93354fa9ae Fix nudge and textbox creation (#672)
* Fix nudge and textbox creation

* Code review

* Cleanup veriable names
2022-06-10 09:25:37 -07:00
mfish33
c618f43c04 Fix crash when deselecting layer while editing properties (#665)
- Remove field acsess after destruction
2022-06-06 18:59:39 -07:00
0HyperCube
469e40d4e9 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-26 16:27:33 -07:00
0HyperCube
889e988fb3 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 14:10:18 -07:00
Keavon Chambers
eca9797597 Refactor source of Git commit build info (closes #661) 2022-05-24 14:33:58 -07:00
0HyperCube
c73f8a64a0 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-23 20:01:36 -07:00
Keavon Chambers
bec7a4c109 Add frontend file structure docs and some related cleanup 2022-05-23 19:24:31 -07:00
Keavon Chambers
ab77105ffb Reorganize Vue components and add documentation explaining each folder 2022-05-23 19:22:41 -07:00
Keavon Chambers
2c2d7bd137 Update the assets directory to prefix icon folders with "icon-" 2022-05-23 18:56:33 -07:00
Keavon Chambers
ef53577b20 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
Keavon Chambers
a8f09da5a2 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
07d5bef125 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
0HyperCube
1481b03c85 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-08 23:35:22 -07:00
0HyperCube
79d40fa451 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-08 20:13:57 -07:00
0HyperCube
f177f63217 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 01:59:52 -07:00
Keavon Chambers
7729b6219e Move the Layer Tree panel's New Folder and Delete icons into the options bar 2022-05-06 13:19:00 -07:00
Keavon Chambers
8c9caf12c7 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
d1c32ad7d0 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
6777864ca3 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
0HyperCube
8a8e94a4bb Stop pointerdown event from properties panel (#600) 2022-04-21 21:14:11 +01:00
Keavon Chambers
d65ce17d7e Rename Crop tool to Artboard tool 2022-04-21 10:52:33 -07:00
0HyperCube
2ace16df0f 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
2022-04-21 10:00:22 +01:00