mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49:45 -05:00
🐛 Fix problem with flex layout controls for padding, gap and margin
This commit is contained in:
parent
2b715851e1
commit
02ab545cda
3 changed files with 9 additions and 10 deletions
|
@ -121,9 +121,9 @@
|
||||||
pill-height (/ fcc/flex-display-pill-height zoom)
|
pill-height (/ fcc/flex-display-pill-height zoom)
|
||||||
workspace-modifiers (mf/deref refs/workspace-modifiers)
|
workspace-modifiers (mf/deref refs/workspace-modifiers)
|
||||||
gap-selected (mf/deref refs/workspace-gap-selected)
|
gap-selected (mf/deref refs/workspace-gap-selected)
|
||||||
hover (mf/use-var nil)
|
hover (mf/use-state nil)
|
||||||
hover-value (mf/use-var 0)
|
hover-value (mf/use-state 0)
|
||||||
mouse-pos (mf/use-var nil)
|
mouse-pos (mf/use-state nil)
|
||||||
padding (:layout-padding frame)
|
padding (:layout-padding frame)
|
||||||
gap (:layout-gap frame)
|
gap (:layout-gap frame)
|
||||||
{:keys [width height x1 y1]} (:selrect frame)
|
{:keys [width height x1 y1]} (:selrect frame)
|
||||||
|
|
|
@ -89,9 +89,9 @@
|
||||||
pill-width (/ fcc/flex-display-pill-width zoom)
|
pill-width (/ fcc/flex-display-pill-width zoom)
|
||||||
pill-height (/ fcc/flex-display-pill-height zoom)
|
pill-height (/ fcc/flex-display-pill-height zoom)
|
||||||
margins-selected (mf/deref refs/workspace-margins-selected)
|
margins-selected (mf/deref refs/workspace-margins-selected)
|
||||||
hover-value (mf/use-var 0)
|
hover-value (mf/use-state 0)
|
||||||
mouse-pos (mf/use-var nil)
|
mouse-pos (mf/use-state nil)
|
||||||
hover (mf/use-var nil)
|
hover (mf/use-state nil)
|
||||||
hover-all? (and (not (nil? @hover)) alt?)
|
hover-all? (and (not (nil? @hover)) alt?)
|
||||||
hover-v? (and (or (= @hover :m1) (= @hover :m3)) shift?)
|
hover-v? (and (or (= @hover :m1) (= @hover :m3)) shift?)
|
||||||
hover-h? (and (or (= @hover :m2) (= @hover :m4)) shift?)
|
hover-h? (and (or (= @hover :m2) (= @hover :m4)) shift?)
|
||||||
|
|
|
@ -77,7 +77,6 @@
|
||||||
:y (:y rect-data)
|
:y (:y rect-data)
|
||||||
:width (max 0 (:width rect-data))
|
:width (max 0 (:width rect-data))
|
||||||
:height (max 0 (:height rect-data))
|
:height (max 0 (:height rect-data))
|
||||||
|
|
||||||
:on-pointer-enter on-pointer-enter
|
:on-pointer-enter on-pointer-enter
|
||||||
:on-pointer-leave on-pointer-leave
|
:on-pointer-leave on-pointer-leave
|
||||||
:on-pointer-move on-pointer-move
|
:on-pointer-move on-pointer-move
|
||||||
|
@ -115,9 +114,9 @@
|
||||||
[{:keys [frame zoom alt? shift? on-move-selected on-context-menu]}]
|
[{:keys [frame zoom alt? shift? on-move-selected on-context-menu]}]
|
||||||
(let [frame-id (:id frame)
|
(let [frame-id (:id frame)
|
||||||
paddings-selected (mf/deref refs/workspace-paddings-selected)
|
paddings-selected (mf/deref refs/workspace-paddings-selected)
|
||||||
hover-value (mf/use-var 0)
|
hover-value (mf/use-state 0)
|
||||||
mouse-pos (mf/use-var nil)
|
mouse-pos (mf/use-state nil)
|
||||||
hover (mf/use-var nil)
|
hover (mf/use-state nil)
|
||||||
hover-all? (and (not (nil? @hover)) alt?)
|
hover-all? (and (not (nil? @hover)) alt?)
|
||||||
hover-v? (and (or (= @hover :p1) (= @hover :p3)) shift?)
|
hover-v? (and (or (= @hover :p1) (= @hover :p3)) shift?)
|
||||||
hover-h? (and (or (= @hover :p2) (= @hover :p4)) shift?)
|
hover-h? (and (or (= @hover :p2) (= @hover :p4)) shift?)
|
||||||
|
|
Loading…
Add table
Reference in a new issue