mirror of
https://github.com/penpot/penpot.git
synced 2025-06-14 14:51:39 +02:00
🐛 Fix problem with measures for frames
This commit is contained in:
parent
2da421bb7a
commit
abe26007d7
2 changed files with 16 additions and 11 deletions
|
@ -214,7 +214,7 @@
|
||||||
(hooks/setup-viewport-size viewport-ref)
|
(hooks/setup-viewport-size viewport-ref)
|
||||||
(hooks/setup-cursor cursor alt? mod? space? panning drawing-tool drawing-path? node-editing? workspace-read-only?)
|
(hooks/setup-cursor cursor alt? mod? space? panning drawing-tool drawing-path? node-editing? workspace-read-only?)
|
||||||
(hooks/setup-keyboard alt? mod? space?)
|
(hooks/setup-keyboard alt? mod? space?)
|
||||||
(hooks/setup-hover-shapes page-id move-stream base-objects transform selected mod? hover hover-ids hover-top-frame-id @hover-disabled? focus zoom)
|
(hooks/setup-hover-shapes page-id move-stream base-objects transform selected mod? hover hover-ids hover-top-frame-id @hover-disabled? focus zoom show-measures?)
|
||||||
(hooks/setup-viewport-modifiers modifiers base-objects)
|
(hooks/setup-viewport-modifiers modifiers base-objects)
|
||||||
(hooks/setup-shortcuts node-editing? drawing-path?)
|
(hooks/setup-shortcuts node-editing? drawing-path?)
|
||||||
(hooks/setup-active-frames base-objects hover-ids selected active-frames zoom transform vbox)
|
(hooks/setup-active-frames base-objects hover-ids selected active-frames zoom transform vbox)
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
(not))))
|
(not))))
|
||||||
|
|
||||||
(defn setup-hover-shapes
|
(defn setup-hover-shapes
|
||||||
[page-id move-stream objects transform selected mod? hover hover-ids hover-top-frame-id hover-disabled? focus zoom]
|
[page-id move-stream objects transform selected mod? hover hover-ids hover-top-frame-id hover-disabled? focus zoom show-measures?]
|
||||||
(let [;; We use ref so we don't recreate the stream on a change
|
(let [;; We use ref so we don't recreate the stream on a change
|
||||||
zoom-ref (mf/use-ref zoom)
|
zoom-ref (mf/use-ref zoom)
|
||||||
mod-ref (mf/use-ref @mod?)
|
mod-ref (mf/use-ref @mod?)
|
||||||
|
@ -192,7 +192,7 @@
|
||||||
|
|
||||||
(hooks/use-stream
|
(hooks/use-stream
|
||||||
over-shapes-stream
|
over-shapes-stream
|
||||||
(mf/deps page-id objects)
|
(mf/deps page-id objects show-measures?)
|
||||||
(fn [ids]
|
(fn [ids]
|
||||||
(let [selected (mf/ref-val selected-ref)
|
(let [selected (mf/ref-val selected-ref)
|
||||||
focus (mf/ref-val focus-ref)
|
focus (mf/ref-val focus-ref)
|
||||||
|
@ -212,15 +212,20 @@
|
||||||
(and (cph/root-frame? obj) (d/not-empty? (:shapes obj))))
|
(and (cph/root-frame? obj) (d/not-empty? (:shapes obj))))
|
||||||
|
|
||||||
;; Set with the elements to remove from the hover list
|
;; Set with the elements to remove from the hover list
|
||||||
remove-id?
|
remove-id-xf
|
||||||
(cond-> selected-with-parents
|
(cond
|
||||||
(not mod?)
|
|
||||||
(into (filter #(or (root-frame-with-data? %)
|
|
||||||
(group-empty-space? % objects ids)))
|
|
||||||
ids)
|
|
||||||
|
|
||||||
mod?
|
mod?
|
||||||
(into (filter grouped?) ids))
|
(filter grouped?)
|
||||||
|
|
||||||
|
show-measures?
|
||||||
|
(filter #(group-empty-space? % objects ids))
|
||||||
|
|
||||||
|
(not mod?)
|
||||||
|
(filter #(or (root-frame-with-data? %)
|
||||||
|
(group-empty-space? % objects ids))))
|
||||||
|
|
||||||
|
remove-id?
|
||||||
|
(into selected-with-parents remove-id-xf ids)
|
||||||
|
|
||||||
hover-shape
|
hover-shape
|
||||||
(->> ids
|
(->> ids
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue