Merge pull request #3165 from penpot/hiru-board-selection

 Give frames that are components more priority on selection
This commit is contained in:
Pablo Alba 2023-04-25 21:31:01 +02:00 committed by GitHub
commit f14641396f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 15 deletions

View file

@ -11,6 +11,7 @@
[app.common.geom.shapes :as gsh]
[app.common.pages :as cp]
[app.common.pages.helpers :as cph]
[app.common.types.component :as ctk]
[app.common.types.shape-tree :as ctt]
[app.common.uuid :as uuid]
[app.main.data.shortcuts :as dsc]
@ -221,7 +222,10 @@
root-frame-with-data?
#(as-> (get objects %) obj
(and (cph/root-frame? obj) (d/not-empty? (:shapes obj))))
(and (cph/root-frame? obj)
(d/not-empty? (:shapes obj))
(not (ctk/instance-root? obj))
(not (ctk/main-instance? obj))))
;; Set with the elements to remove from the hover list
remove-id-xf