From 8e9ab32a9fe4ca00e57ea233f74ff54663469457 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 14 Jul 2022 13:17:52 +0200 Subject: [PATCH] :bug: Fix moving frame-guides outside frames --- CHANGES.md | 1 + .../src/app/main/ui/workspace/viewport/guides.cljs | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 4c8669e72..0338f1009 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -34,6 +34,7 @@ - Fix problem with group coordinates [#2008](https://github.com/penpot/penpot/issues/2008) - Fix problem with line-height and texts [Taiga #3578](https://tree.taiga.io/project/penpot/issue/3578) +- Fix moving frame-guides outside frames [Taiga #3839](https://tree.taiga.io/project/penpot/issue/3839) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/ui/workspace/viewport/guides.cljs b/frontend/src/app/main/ui/workspace/viewport/guides.cljs index 363feed7b..ed338e282 100644 --- a/frontend/src/app/main/ui/workspace/viewport/guides.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/guides.cljs @@ -284,13 +284,16 @@ pos (+ (or (:new-position @state) (:position guide)) (get move-vec axis)) guide-width (/ guide-width zoom) - guide-pill-corner-radius (/ guide-pill-corner-radius zoom)] + guide-pill-corner-radius (/ guide-pill-corner-radius zoom) + + frame-guide-outside? + (and (some? frame) + (not (is-guide-inside-frame? (assoc guide :position pos) frame)))] (when (or (nil? frame) - (and (is-guide-inside-frame? (assoc guide :position pos) frame) - (cph/root-frame? frame) + (and (cph/root-frame? frame) (not (cph/rotated-frame? frame)))) - [:g.guide-area + [:g.guide-area {:opacity (when frame-guide-outside? 0)} (when-not disabled-guides? (let [{:keys [x y width height]} (guide-area-axis pos vbox zoom frame axis)] [:rect {:x x @@ -298,7 +301,7 @@ :width width :height height :style {:fill "none" - :pointer-events "fill" + :pointer-events (if frame-guide-outside? "none" "fill") :cursor (if (= axis :x) (cur/resize-ew 0) (cur/resize-ns 0))} :on-pointer-enter on-pointer-enter :on-pointer-leave on-pointer-leave