Commit Graph
18 Commits
Author SHA1 Message Date
Henry SloanandKeavon Chambers 4421b79ec4 Add two-way tool option messaging system between frontend/backend (#361)
* Add two-way tool option messaging system

* Rename tool option functions

* Move repeated frontend messaging code to function

* Address style comments

* Rename variable to be more descriptive

* Move tool options update to SetActiveTool message

* Refactor record of all tool options

* Only pass active tool options to bar

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2021-08-28 21:43:27 -07:00
Henry Sloan 564aaf7ca3 Add a stroke width option to the Line Tool (#355)
* Add a stroke width option to the Line Tool

* Fix title case for line options

* Add px unit to line stroke width

* Add stroke width to pen tool

* Rename stroke width to weight

* Change number input width to min-width

* Remove the word "stroke" from "stroke weight"
2021-08-23 21:55:59 -04:00
Henry Sloan 0dda197d65 Ignore mouse events without any button state changes (#343) 2021-08-11 22:26:46 -07:00
Henry Sloan 340c10a62b Change eyedropper to use correct message (#327) 2021-08-03 13:35:26 -07:00
Henry Sloan 4cf0686801 Change flipping to use the joint bounding box of the selection (#323)
* Change flipping to use the joint bounding box

* Fix minor untested changes

* Replace unwrap with question mark
2021-07-31 15:18:54 -07:00
Henry Sloan 8e904c11cb Move blend mode declaration and implementation (#308) 2021-07-25 13:01:50 -07:00
Henry Sloan 91a93c1dc0 Avoid looping behavior with color selection (#305) 2021-07-25 02:31:50 -04:00
Henry Sloan 3920f81f58 Add alignment of selected layers (#296)
* Add alignment of selected layers

* Refactor alignment to a document message

* Condense align messages into a tuple variant

* Rename dimension to axis and fix redundant math

* Add correct Center alignment

* Add TODO comment for nested transforms

* Add TODO for merging bounding boxes

* Move align enums to document_message_handler

* Run cargo clippy

* Clean up unwraps with filter_map
2021-07-24 19:35:48 -04:00
Henry Sloan 7d3239ecac MVP eyedropper tool for fill colors (#300)
* Implement eyedropper for layer fill colors

* Add shortcut for eyedropper

* Add right mouse sampling for secondary color
2021-07-24 18:29:32 -04:00
Henry Sloan 57940d8cac Rename align operations and icons (#295)
* Rename align operations and icons

* Fix icon import paths
2021-07-24 00:42:48 -04:00
Henry Sloan a65b525a5d Add dragging of layers with the select tool (#293)
* Add dragging of layers with the select tool

* Transform mouse positions based on root transform

* Add TODOs regarding root inverse transforms
2021-07-23 21:51:14 -04:00
Henry Sloan 988dd7b400 Change tool option kinds to PascalCase (#292) 2021-07-23 14:47:55 -07:00
Henry Sloan 53322848fb Implement tool messaging and shape flipping (#288) 2021-07-22 16:25:42 -04:00
Henry Sloan 1f1c307211 Options bar widgets for tools to control tool behavior (#283)
* Add JSON-backed options widget

* Add initial tool settings messaging to backend

* Add shape side selection with JSON deserialization

* Enforce minimum number of n-gon sides

* Make tool settings JSON errors safer

* Make tool settings JSON errors safer

* Refactor ToolOptions to ToolSettings

* Revert "Refactor ToolOptions to ToolSettings"

This reverts commit 651161fd16.

* Refactor all instances of "settings" to "options"

* Fix names and formatting

* Rearrange ToolOptions data to enforce types
2021-07-21 01:07:48 -04:00
Henry Sloan 08d5536663 Pass layer metadata to tools (#277) 2021-07-16 08:38:46 +02:00
Henry Sloan 2e579a3ac6 Transform nudge coordinates to viewport space (#264)
* Transform nudge coordinates to viewport space

* Refactor nudge transform for clarity
2021-07-14 23:05:46 -07:00
Henry Sloan 8158d4be0e Implement fill tool (#254)
* Implement fill tool

* Add fill tool shortcut

* Add getters and setters to styles

* Make fill tool act on the topmost layer clicked

* Refactor fill operation

* Refactor and unify selection tolerance

* Add mark_as_dirty function

* Fix getter names
2021-07-14 00:49:12 -07:00
Henry Sloan 3353974a0b Implement nudging selected layers with arrow keys (#245)
* Implement nudging selected layers with arrow keys

* Normalize diagonal nudges and add constants

* Replace sqrt(2.0) with a constant

* Remove normalization of diagonal movement
2021-07-11 19:22:26 -07:00