0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-02 04:19:08 -05:00

🐛 Fix overlay position in open-overlay

This commit is contained in:
Andrés Moya 2023-07-06 12:43:59 +02:00
parent 91037caa55
commit a2d1ce8120
2 changed files with 13 additions and 13 deletions

View file

@ -63,6 +63,7 @@
- Fix search bar width on layer tab [Taiga #5445](https://tree.taiga.io/project/penpot/issue/5445) - 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 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 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 ### :arrow_up: Deps updates

View file

@ -59,8 +59,7 @@
:open-overlay :open-overlay
(let [dest-frame-id (:destination interaction) (let [dest-frame-id (:destination interaction)
viewer-objects (deref (refs/get-viewer-objects)) dest-frame (get objects dest-frame-id)
dest-frame (get viewer-objects dest-frame-id)
relative-to-id (if (= :manual (:overlay-pos-type interaction)) relative-to-id (if (= :manual (:overlay-pos-type interaction))
(:id shape) ;; manual interactions are allways from "self" (:id shape) ;; manual interactions are allways from "self"
(:position-relative-to interaction)) (: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) relative-to-base-frame (find-relative-to-base-frame relative-to-shape objects overlays-ids base-frame)
position (ctsi/calc-overlay-position interaction position (ctsi/calc-overlay-position interaction
shape shape
viewer-objects objects
relative-to-shape relative-to-shape
relative-to-base-frame relative-to-base-frame
dest-frame dest-frame
@ -84,8 +83,8 @@
(:animation interaction))))) (:animation interaction)))))
:toggle-overlay :toggle-overlay
(let [frame-id (:destination interaction) (let [dest-frame-id (:destination interaction)
dest-frame (get objects frame-id) dest-frame (get objects dest-frame-id)
relative-to-id (if (= :manual (:overlay-pos-type interaction)) relative-to-id (if (= :manual (:overlay-pos-type interaction))
(:id shape) ;; manual interactions are allways from "self" (:id shape) ;; manual interactions are allways from "self"
(:position-relative-to interaction)) (:position-relative-to interaction))
@ -102,19 +101,19 @@
close-click-outside (:close-click-outside interaction) close-click-outside (:close-click-outside interaction)
background-overlay (:background-overlay interaction)] background-overlay (:background-overlay interaction)]
(when frame-id (when dest-frame-id
(st/emit! (dv/toggle-overlay frame-id (st/emit! (dv/toggle-overlay dest-frame-id
position position
close-click-outside close-click-outside
background-overlay background-overlay
(:animation interaction))))) (:animation interaction)))))
:close-overlay :close-overlay
(let [frame-id (or (:destination interaction) (let [dest-frame-id (or (:destination interaction)
(if (= (:type shape) :frame) (if (= (:type shape) :frame)
(:id shape) (:id shape)
(:frame-id shape)))] (:frame-id shape)))]
(st/emit! (dv/close-overlay frame-id (:animation interaction)))) (st/emit! (dv/close-overlay dest-frame-id (:animation interaction))))
:prev-screen :prev-screen
(st/emit! (rt/nav-back-local)) (st/emit! (rt/nav-back-local))