From a2d1ce81209e1b3b4568c35af579e04093c6801b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Thu, 6 Jul 2023 12:43:59 +0200 Subject: [PATCH] :bug: Fix overlay position in open-overlay --- CHANGES.md | 3 ++- frontend/src/app/main/ui/viewer/shapes.cljs | 23 ++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5d11dac02..d09d084ae 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -63,7 +63,8 @@ - Fix search bar width on layer tab [Taiga #5445](https://tree.taiga.io/project/penpot/issue/5445) - Fix border radius values with decimals [Taiga #5283](https://tree.taiga.io/project/penpot/issue/5283) - Fix shortcuts translations not homogenized [Taiga #5141](https://tree.taiga.io/project/penpot/issue/5141) - +- Fix overlay manual position in nested boards [Taiga #5135](https://tree.taiga.io/project/penpot/issue/5135) + ### :arrow_up: Deps updates - Update google fonts catalog (at 2023/07/06) [Taiga #5592](https://tree.taiga.io/project/penpot/issue/5592) diff --git a/frontend/src/app/main/ui/viewer/shapes.cljs b/frontend/src/app/main/ui/viewer/shapes.cljs index 619e0a159..4d279cd0f 100644 --- a/frontend/src/app/main/ui/viewer/shapes.cljs +++ b/frontend/src/app/main/ui/viewer/shapes.cljs @@ -59,8 +59,7 @@ :open-overlay (let [dest-frame-id (:destination interaction) - viewer-objects (deref (refs/get-viewer-objects)) - dest-frame (get viewer-objects dest-frame-id) + dest-frame (get objects dest-frame-id) relative-to-id (if (= :manual (:overlay-pos-type interaction)) (:id shape) ;; manual interactions are allways from "self" (:position-relative-to interaction)) @@ -71,7 +70,7 @@ relative-to-base-frame (find-relative-to-base-frame relative-to-shape objects overlays-ids base-frame) position (ctsi/calc-overlay-position interaction shape - viewer-objects + objects relative-to-shape relative-to-base-frame dest-frame @@ -84,8 +83,8 @@ (:animation interaction))))) :toggle-overlay - (let [frame-id (:destination interaction) - dest-frame (get objects frame-id) + (let [dest-frame-id (:destination interaction) + dest-frame (get objects dest-frame-id) relative-to-id (if (= :manual (:overlay-pos-type interaction)) (:id shape) ;; manual interactions are allways from "self" (:position-relative-to interaction)) @@ -102,19 +101,19 @@ close-click-outside (:close-click-outside interaction) background-overlay (:background-overlay interaction)] - (when frame-id - (st/emit! (dv/toggle-overlay frame-id + (when dest-frame-id + (st/emit! (dv/toggle-overlay dest-frame-id position close-click-outside background-overlay (:animation interaction))))) :close-overlay - (let [frame-id (or (:destination interaction) - (if (= (:type shape) :frame) - (:id shape) - (:frame-id shape)))] - (st/emit! (dv/close-overlay frame-id (:animation interaction)))) + (let [dest-frame-id (or (:destination interaction) + (if (= (:type shape) :frame) + (:id shape) + (:frame-id shape)))] + (st/emit! (dv/close-overlay dest-frame-id (:animation interaction)))) :prev-screen (st/emit! (rt/nav-back-local))