Commit Graph
18 Commits
Author SHA1 Message Date
Henry SloanandKeavon Chambers 8336b3e809 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 98fde72d4a 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 da77820c82 Ignore mouse events without any button state changes (#343) 2021-08-11 22:26:46 -07:00
Henry Sloan 86a9778ef0 Change eyedropper to use correct message (#327) 2021-08-03 13:35:26 -07:00
Henry Sloan 09695f7777 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 3cd2260320 Move blend mode declaration and implementation (#308) 2021-07-25 13:01:50 -07:00
Henry Sloan 445329705d Avoid looping behavior with color selection (#305) 2021-07-25 02:31:50 -04:00
Henry Sloan 9d0e194857 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 da8422786b 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 0d681a533a 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 d15d7d0fab 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 d30d44eb70 Change tool option kinds to PascalCase (#292) 2021-07-23 14:47:55 -07:00
Henry Sloan 7b79ad1341 Implement tool messaging and shape flipping (#288) 2021-07-22 16:25:42 -04:00
Henry Sloan 06c26f44d0 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 7a087ba71a Pass layer metadata to tools (#277) 2021-07-16 08:38:46 +02:00
Henry Sloan 7f1ad04a28 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 9d34aa4867 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 3fc7722d89 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