Implement the Properties panel with a transform section for layers#527
Conversation
- removed hashmap from layout message handler - removed no op message from layoutMessage
Deploying with
|
| Latest commit: |
dfb5105
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0643d865.graphite-master.pages.dev |
0HyperCube
left a comment
There was a problem hiding this comment.
Looks good :)
Great work on this, makes it feel like an actual graphics editor.
| } | ||
| #[remain::unsorted] | ||
| PropertiesPanel(message) => { | ||
| self.properties_panel_message_handler.process_action(message, &mut self.graphene_document, responses); |
There was a problem hiding this comment.
Does not need to be mutable access to document
| } | ||
|
|
||
| fn actions(&self) -> ActionList { | ||
| actions!(ArtboardMessageDiscriminant;) |
There was a problem hiding this comment.
ArtboardMessageDiscriminant?
| // 1.23 == 1 | ||
| // 0.23 == 0 (Reason for the slightly more complicated code) | ||
| const leftSideDigits = Math.max(Math.floor(value).toString().length, 0) * Math.sign(value); | ||
| const leftSideDigits = Math.abs(Math.max(Math.floor(value).toString().length, 0) * Math.sign(value)); |
There was a problem hiding this comment.
Why multiply by sign and then abs?
- fixed actions for properties message handler
| self.transform_vector2((1., 0.).into()).length() | ||
| } | ||
|
|
||
| fn update_width(self, new_width: f64) -> Self { |
There was a problem hiding this comment.
I would expect a function called update to actually update something by taking a &mut ref
There was a problem hiding this comment.
I agree however for most of the functions it is easier to just create Daffine instead of modifying since it is copy. Is there a better name that you can suggest? It also helps in the message handler below to have a consistent call signature on the update functions.
There was a problem hiding this comment.
Maybe something like update_with_transform?
Another way of going about this would be to ditch the update mentality and just recreate the complete transform every time.
But that is technically doing more work than necessary
Closes #146
This PR has the transform shape properties working. The next steps are to add styling and the rest of the modifiable properties (#529).