0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 10:38:13 -05:00

🐛 Fix guides inside frames issues

This commit is contained in:
Alejandro Alonso 2022-12-29 09:44:19 +01:00 committed by Alonso Torres
parent dcf95a7502
commit d4360be96e
3 changed files with 8 additions and 7 deletions

View file

@ -79,7 +79,7 @@
build-move-event
(fn [guide]
(let [frame (get objects (:frame-id guide))
frame' (gsh/transform-shape (get object-modifiers (:frame-id guide)))
frame' (gsh/transform-shape frame (get-in object-modifiers [(:frame-id guide) :modifiers]))
moved (gpt/to-vec (gpt/point (:x frame) (:y frame))
(gpt/point (:x frame') (:y frame')))

View file

@ -437,7 +437,8 @@
{:zoom zoom
:vbox vbox
:hover-frame frame-parent
:disabled-guides? disabled-guides?}])
:disabled-guides? disabled-guides?
:modifiers modifiers}])
;; DEBUG LAYOUT DROP-ZONES
(when (debug? :layout-drop-zones)

View file

@ -65,7 +65,7 @@
(fn []
(st/emit! (dw/set-hover-guide id false))
(swap! state assoc :hover false)))
on-pointer-down
(mf/use-callback
(fn [event]
@ -96,7 +96,7 @@
(mf/use-callback
(mf/deps position zoom snap-pixel?)
(fn [event]
(when-let [_ (mf/ref-val dragging-ref)]
(let [start-pt (mf/ref-val start-ref)
start-pos (mf/ref-val start-pos-ref)
@ -142,7 +142,7 @@
:y (- pos (/ guide-active-area 2))
:width (:width frame)
:height guide-active-area}
(= axis :x)
{:x (- pos (/ guide-active-area 2))
:y (+ (:y vbox) rules-pos)
@ -476,7 +476,7 @@
:axis :y
:get-hover-frame get-hover-frame
:disabled-guides? disabled-guides?}]
(for [current guides]
(when (or (nil? (:frame-id current))
(empty? focus)
@ -485,7 +485,7 @@
:guide current
:vbox vbox
:zoom zoom
:frame-modifier (get modifiers (:frame-id current))
:frame-modifier (get-in modifiers [(:frame-id current) :modifiers])
:get-hover-frame get-hover-frame
:on-guide-change on-guide-change
:disabled-guides? disabled-guides?}]))]))