mirror of
https://github.com/penpot/penpot.git
synced 2025-02-14 11:09:04 -05:00
Merge pull request #2028 from penpot/alotor-frames
✨ Improved nested boards thumbnail handling
This commit is contained in:
commit
dc7464220d
2 changed files with 7 additions and 5 deletions
|
@ -69,7 +69,7 @@
|
||||||
|
|
||||||
wrapper-props
|
wrapper-props
|
||||||
(-> (obj/clone props)
|
(-> (obj/clone props)
|
||||||
(obj/without ["shape" "children"])
|
(obj/without ["shape" "children" "disable-shadows?"])
|
||||||
(obj/set! "ref" ref)
|
(obj/set! "ref" ref)
|
||||||
(obj/set! "id" (dm/fmt "shape-%" (:id shape)))
|
(obj/set! "id" (dm/fmt "shape-%" (:id shape)))
|
||||||
(obj/set! "style" styles))
|
(obj/set! "style" styles))
|
||||||
|
|
|
@ -229,10 +229,12 @@
|
||||||
(defn setup-active-frames
|
(defn setup-active-frames
|
||||||
[objects hover-ids selected active-frames zoom transform vbox]
|
[objects hover-ids selected active-frames zoom transform vbox]
|
||||||
|
|
||||||
(let [frame? #(= :frame (get-in objects [% :type]))
|
(let [all-frames (mf/use-memo (mf/deps objects) #(cph/get-root-frames-ids objects))
|
||||||
all-frames (mf/use-memo (mf/deps objects) #(cph/get-root-frames-ids objects))
|
|
||||||
selected-frames (mf/use-memo (mf/deps selected) #(->> all-frames (filter selected)))
|
selected-frames (mf/use-memo (mf/deps selected) #(->> all-frames (filter selected)))
|
||||||
xf-selected-frame (comp (remove frame?) (map #(get-in objects [% :frame-id])))
|
|
||||||
|
xf-selected-frame (comp (remove cph/root-frame?)
|
||||||
|
(map #(cph/get-shape-id-root-frame objects %)))
|
||||||
|
|
||||||
selected-shapes-frames (mf/use-memo (mf/deps selected) #(into #{} xf-selected-frame selected))
|
selected-shapes-frames (mf/use-memo (mf/deps selected) #(into #{} xf-selected-frame selected))
|
||||||
|
|
||||||
active-selection (when (and (not= transform :move) (= (count selected-frames) 1)) (first selected-frames))
|
active-selection (when (and (not= transform :move) (= (count selected-frames) 1)) (first selected-frames))
|
||||||
|
@ -255,7 +257,7 @@
|
||||||
;; - If no hovering over any frames we keep the previous active one
|
;; - If no hovering over any frames we keep the previous active one
|
||||||
;; - Check always that the active frames are inside the vbox
|
;; - Check always that the active frames are inside the vbox
|
||||||
|
|
||||||
(let [hover-ids? (set @hover-ids)
|
(let [hover-ids? (set (->> @hover-ids (map #(cph/get-shape-id-root-frame objects %))))
|
||||||
|
|
||||||
is-active-frame?
|
is-active-frame?
|
||||||
(fn [id]
|
(fn [id]
|
||||||
|
|
Loading…
Add table
Reference in a new issue