mirror of
https://github.com/penpot/penpot.git
synced 2025-08-04 15:18:23 +02:00
Fix many inconsistencies between drawing and resizing.
This enables sharing code between the drawing logic and the simple resizing. Allowing drawing in any direction, not only from top-left to bottom-right. Fixes issue #44.
This commit is contained in:
parent
b7253b7fd5
commit
f82ddac72d
16 changed files with 291 additions and 321 deletions
|
@ -66,16 +66,29 @@
|
|||
(-> (l/key :tooltip)
|
||||
(l/derive workspace)))
|
||||
|
||||
(def selected-drawing-shape
|
||||
(-> (l/key :drawing)
|
||||
(l/derive workspace)))
|
||||
|
||||
(def selected-drawing-tool
|
||||
(-> (l/key :drawing-tool)
|
||||
(l/derive workspace)))
|
||||
|
||||
(def selected-edition
|
||||
(-> (l/key :edition)
|
||||
(l/derive workspace)))
|
||||
|
||||
(defn selected-modifiers
|
||||
[id]
|
||||
{:pre [(uuid? id)]}
|
||||
(-> (l/in [:modifiers id])
|
||||
(l/derive workspace)))
|
||||
|
||||
(defn alignment-activated?
|
||||
[state]
|
||||
(let [flags (l/focus ul/workspace-flags state)]
|
||||
(and (contains? flags :grid-indexed)
|
||||
(contains? flags :grid-alignment)
|
||||
(contains? flags :grid))))
|
||||
[flags]
|
||||
(and (contains? flags :grid-indexed)
|
||||
(contains? flags :grid-alignment)
|
||||
(contains? flags :grid)))
|
||||
|
||||
(def selected-alignment
|
||||
(-> (l/lens alignment-activated?)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue