mirror of
https://github.com/penpot/penpot.git
synced 2025-01-22 14:39:45 -05:00
🐛 Fix behavior of select all command when there are objects outside frames
This commit is contained in:
parent
f8ccd0b120
commit
30819a08f4
3 changed files with 10 additions and 7 deletions
|
@ -3,6 +3,7 @@
|
|||
## Next
|
||||
|
||||
### New features
|
||||
|
||||
### Bugs fixed
|
||||
|
||||
|
||||
|
@ -18,6 +19,7 @@
|
|||
- Improve component testing
|
||||
- Increase default deletion delay to 7 days
|
||||
- Show a pixel grid when zoom greater than 800% [#519](https://github.com/penpot/penpot/discussions/519)
|
||||
- Fix behavior of select all command when there are objects outside frames [Taiga #1209](https://tree.taiga.io/project/penpot/issue/1209)
|
||||
|
||||
|
||||
### Bugs fixed
|
||||
|
|
|
@ -224,7 +224,9 @@
|
|||
|
||||
(defn select-toplevel-shapes
|
||||
([objects] (select-toplevel-shapes objects nil))
|
||||
([objects {:keys [include-frames?] :or {include-frames? false}}]
|
||||
([objects {:keys [include-frames? include-frame-children?]
|
||||
:or {include-frames? false
|
||||
include-frame-children? true}}]
|
||||
(let [lookup #(get objects %)
|
||||
root (lookup uuid/zero)
|
||||
root-children (:shapes root)
|
||||
|
@ -241,7 +243,7 @@
|
|||
(or (not= :frame typ) include-frames?)
|
||||
(d/concat [obj])
|
||||
|
||||
(= :frame typ)
|
||||
(and (= :frame typ) include-frame-children?)
|
||||
(d/concat (map lookup children))))))]
|
||||
|
||||
(reduce lookup-shapes [] root-children))))
|
||||
|
|
|
@ -164,11 +164,10 @@
|
|||
(not= (:id common-frame-id) uuid/zero))
|
||||
(-> (get objects common-frame-id)
|
||||
:shapes)
|
||||
(let [frames (cp/select-frames objects)]
|
||||
(->> (if (seq frames)
|
||||
frames
|
||||
(cp/select-toplevel-shapes objects))
|
||||
(map :id)))))
|
||||
(->> (cp/select-toplevel-shapes objects
|
||||
{:include-frames? true
|
||||
:include-frame-children? false})
|
||||
(map :id))))
|
||||
|
||||
is-not-blocked (fn [shape-id] (not (get-in state [:workspace-data
|
||||
:pages-index page-id
|
||||
|
|
Loading…
Add table
Reference in a new issue