mirror of
https://github.com/penpot/penpot.git
synced 2025-08-01 09:38:27 +02:00
✨ Fix problem with booleans selection (#6950)
This commit is contained in:
parent
b477ca0508
commit
dfc8a1da4a
5 changed files with 14 additions and 27 deletions
|
@ -12,6 +12,7 @@
|
|||
|
||||
### :bug: Bugs fixed
|
||||
|
||||
- Fix problem with booleans selection [Taiga #11627](https://tree.taiga.io/project/penpot/issue/11627)
|
||||
|
||||
## 2.9.0 (Unreleased)
|
||||
|
||||
|
|
|
@ -30,16 +30,14 @@
|
|||
get-clip-parents
|
||||
(fn [shape]
|
||||
(cond-> []
|
||||
(and (= :frame (:type shape))
|
||||
(not (:show-content shape))
|
||||
(not= uuid/zero (:id shape)))
|
||||
(or (and (= :frame (:type shape))
|
||||
(not (:show-content shape))
|
||||
(not= uuid/zero (:id shape)))
|
||||
(cfh/bool-shape? shape))
|
||||
(conj shape)
|
||||
|
||||
(:masked-group shape)
|
||||
(conj (get objects (->> shape :shapes first)))
|
||||
|
||||
(= :bool (:type shape))
|
||||
(conj shape)))]
|
||||
(conj (get objects (->> shape :shapes first)))))]
|
||||
|
||||
(into []
|
||||
(comp (map lookup-object)
|
||||
|
|
|
@ -315,7 +315,8 @@
|
|||
(update :height + (* 2 swidth)))]
|
||||
(or (not shape)
|
||||
(cond
|
||||
(cfh/path-shape? shape)
|
||||
(or (cfh/path-shape? shape)
|
||||
(cfh/bool-shape? shape))
|
||||
(and (overlaps-rect-points? rect (:points shape))
|
||||
(overlaps-path? shape rect true))
|
||||
|
||||
|
|
|
@ -171,19 +171,6 @@
|
|||
(dw/decrease-zoom)
|
||||
(dw/increase-zoom)))))))
|
||||
|
||||
|
||||
(defn group-empty-space?
|
||||
"Given a group `group-id` check if `hover-ids` contains any of its children. If it doesn't means
|
||||
we're hovering over empty space for the group "
|
||||
[group-id objects hover-ids]
|
||||
|
||||
(and (contains? #{:group :bool} (get-in objects [group-id :type]))
|
||||
;; If there are no children in the hover-ids we're in the empty side
|
||||
(->> hover-ids
|
||||
(remove #(contains? #{:group :bool} (get-in objects [% :type])))
|
||||
(some #(cfh/is-parent? objects % group-id))
|
||||
(not))))
|
||||
|
||||
(defn setup-hover-shapes
|
||||
[page-id move-stream objects transform selected mod? hover measure-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
|
||||
|
@ -211,7 +198,7 @@
|
|||
:page-id page-id
|
||||
:rect rect
|
||||
:include-frames? true
|
||||
:clip-children? true
|
||||
:clip-children? (not (mf/ref-val mod-ref))
|
||||
:using-selrect? false})
|
||||
;; When the ask-buffered is canceled returns null. We filter them
|
||||
;; to improve the behavior
|
||||
|
@ -297,7 +284,7 @@
|
|||
|
||||
grouped?
|
||||
(fn [id]
|
||||
(and (cfh/group-shape? objects id)
|
||||
(and (cfh/group-like-shape? objects id)
|
||||
(not (cfh/mask-shape? objects id))))
|
||||
|
||||
selected-with-parents
|
||||
|
@ -319,11 +306,11 @@
|
|||
(not mod?)
|
||||
(let [child-parent?
|
||||
(into #{}
|
||||
(comp (remove #(cfh/group-like-shape? objects %))
|
||||
(comp (remove #(cfh/group-shape? objects %))
|
||||
(mapcat #(cfh/get-parent-ids objects %)))
|
||||
ids)]
|
||||
(filter #(or (root-frame-with-data? %)
|
||||
(and (contains? #{:group :bool} (dm/get-in objects [% :type]))
|
||||
(and (cfh/group-shape? objects %)
|
||||
(not (contains? child-parent? %)))))))
|
||||
|
||||
remove-measure-xf
|
||||
|
@ -337,7 +324,7 @@
|
|||
(comp (remove #(cfh/group-like-shape? objects %))
|
||||
(mapcat #(cfh/get-parent-ids objects %)))
|
||||
ids)]
|
||||
(filter #(and (contains? #{:group :bool} (dm/get-in objects [% :type]))
|
||||
(filter #(and (cfh/group-shape? objects %)
|
||||
(not (contains? child-parent? %))))))
|
||||
|
||||
remove-hover?
|
||||
|
|
|
@ -212,7 +212,7 @@
|
|||
;; If the shape has no fills the overlap depends on the stroke
|
||||
:rect (and (overlaps-outer-shape? shape) (not (overlaps-inner-shape? shape)))
|
||||
:circle (and (overlaps-outer-shape? shape) (not (overlaps-inner-shape? shape)))
|
||||
:path (overlaps-path? shape)
|
||||
(:bool :path) (overlaps-path? shape)
|
||||
(gsh/overlaps? shape rect))
|
||||
(gsh/overlaps? shape rect)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue