mirror of
https://github.com/penpot/penpot.git
synced 2025-07-23 18:17:19 +02:00
🐛 Fixed measurement problem in handoff
This commit is contained in:
parent
3dc4893cf1
commit
29180e4196
1 changed files with 8 additions and 9 deletions
|
@ -60,11 +60,9 @@
|
||||||
;; HELPERS
|
;; HELPERS
|
||||||
;; ------------------------------------------------
|
;; ------------------------------------------------
|
||||||
|
|
||||||
(defn frame->selrect [frame]
|
(defn frame->bounds [frame]
|
||||||
{:x1 0
|
{:x 0
|
||||||
:y1 0
|
:y 0
|
||||||
:x2 (:width frame)
|
|
||||||
:y2 (:height frame)
|
|
||||||
:width (:width frame)
|
:width (:width frame)
|
||||||
:height (:height frame)})
|
:height (:height frame)})
|
||||||
|
|
||||||
|
@ -88,23 +86,24 @@
|
||||||
(let [zoom (mf/deref selected-zoom)
|
(let [zoom (mf/deref selected-zoom)
|
||||||
|
|
||||||
hover-shapes-ref (mf/use-memo (make-hover-shapes-iref))
|
hover-shapes-ref (mf/use-memo (make-hover-shapes-iref))
|
||||||
hover-shape (-> (mf/deref hover-shapes-ref)
|
hover-shape (-> (or (mf/deref hover-shapes-ref) frame)
|
||||||
(gsh/translate-to-frame frame))
|
(gsh/translate-to-frame frame))
|
||||||
|
|
||||||
selected-shapes-ref (mf/use-memo (make-selected-shapes-iref))
|
selected-shapes-ref (mf/use-memo (make-selected-shapes-iref))
|
||||||
selected-shapes (->> (mf/deref selected-shapes-ref)
|
selected-shapes (->> (mf/deref selected-shapes-ref)
|
||||||
(map #(gsh/translate-to-frame % frame)))
|
(map #(gsh/translate-to-frame % frame)))
|
||||||
|
|
||||||
selrect (gsh/selection-rect selected-shapes)]
|
selrect (gsh/selection-rect selected-shapes)
|
||||||
|
bounds (frame->bounds frame)]
|
||||||
|
|
||||||
(when (seq selected-shapes)
|
(when (seq selected-shapes)
|
||||||
[:g.selection-feedback {:pointer-events "none"}
|
[:g.selection-feedback {:pointer-events "none"}
|
||||||
[:g.selected-shapes
|
[:g.selected-shapes
|
||||||
[:& selection-guides {:selrect selrect :frame frame :zoom zoom}]
|
[:& selection-guides {:bounds bounds :selrect selrect :zoom zoom}]
|
||||||
[:& selection-rect {:selrect selrect :zoom zoom}]
|
[:& selection-rect {:selrect selrect :zoom zoom}]
|
||||||
[:& size-display {:selrect selrect :zoom zoom}]]
|
[:& size-display {:selrect selrect :zoom zoom}]]
|
||||||
|
|
||||||
[:& measurement {:bounds frame
|
[:& measurement {:bounds bounds
|
||||||
:selected-shapes selected-shapes
|
:selected-shapes selected-shapes
|
||||||
:hover-shape hover-shape
|
:hover-shape hover-shape
|
||||||
:zoom zoom}]])))
|
:zoom zoom}]])))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue