0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 22:49:01 -05:00

🐛 Fix behavior of select all command when there are objects outside frames

This commit is contained in:
Andrés Moya 2021-02-12 17:12:01 +01:00
parent f8ccd0b120
commit 30819a08f4
3 changed files with 10 additions and 7 deletions

View file

@ -3,6 +3,7 @@
## Next ## Next
### New features ### New features
### Bugs fixed ### Bugs fixed
@ -18,6 +19,7 @@
- Improve component testing - Improve component testing
- Increase default deletion delay to 7 days - Increase default deletion delay to 7 days
- Show a pixel grid when zoom greater than 800% [#519](https://github.com/penpot/penpot/discussions/519) - 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 ### Bugs fixed

View file

@ -224,7 +224,9 @@
(defn select-toplevel-shapes (defn select-toplevel-shapes
([objects] (select-toplevel-shapes objects nil)) ([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 %) (let [lookup #(get objects %)
root (lookup uuid/zero) root (lookup uuid/zero)
root-children (:shapes root) root-children (:shapes root)
@ -241,7 +243,7 @@
(or (not= :frame typ) include-frames?) (or (not= :frame typ) include-frames?)
(d/concat [obj]) (d/concat [obj])
(= :frame typ) (and (= :frame typ) include-frame-children?)
(d/concat (map lookup children))))))] (d/concat (map lookup children))))))]
(reduce lookup-shapes [] root-children)))) (reduce lookup-shapes [] root-children))))

View file

@ -164,11 +164,10 @@
(not= (:id common-frame-id) uuid/zero)) (not= (:id common-frame-id) uuid/zero))
(-> (get objects common-frame-id) (-> (get objects common-frame-id)
:shapes) :shapes)
(let [frames (cp/select-frames objects)] (->> (cp/select-toplevel-shapes objects
(->> (if (seq frames) {:include-frames? true
frames :include-frame-children? false})
(cp/select-toplevel-shapes objects)) (map :id))))
(map :id)))))
is-not-blocked (fn [shape-id] (not (get-in state [:workspace-data is-not-blocked (fn [shape-id] (not (get-in state [:workspace-data
:pages-index page-id :pages-index page-id