diff --git a/CHANGES.md b/CHANGES.md index 14ffe6921..be5e6a75b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -68,6 +68,8 @@ - Fix error after user drags any layer in search functionality [Taiga #4161](https://tree.taiga.io/project/penpot/issue/4161) - Fix font search works only with lowercase letters [Taiga #4140](https://tree.taiga.io/project/penpot/issue/4140) - Fix Terms and Privacy links overlapping [Taiga #4137](https://tree.taiga.io/project/penpot/issue/4137) +- Fix Export bounding box mask [Taiga #950](https://tree.taiga.io/project/penpot/issue/950) +- Fix delete layers in bulk [Taiga #4160](https://tree.taiga.io/project/penpot/issue/4160) ## 1.15.3-beta diff --git a/common/src/app/common/geom/shapes/bounds.cljc b/common/src/app/common/geom/shapes/bounds.cljc index 3220d2548..33227cc36 100644 --- a/common/src/app/common/geom/shapes/bounds.cljc +++ b/common/src/app/common/geom/shapes/bounds.cljc @@ -133,7 +133,7 @@ (-> (get-shape-filter-bounds shape) (add-padding (calculate-padding shape true)))) - bounds (if (cph/frame-shape? shape) + bounds (if (or (:masked-group? shape) (cph/frame-shape? shape)) [(calculate-base-bounds shape)] (cph/reduce-objects objects diff --git a/frontend/src/app/main/data/workspace/selection.cljs b/frontend/src/app/main/data/workspace/selection.cljs index a4394c0df..83122fa22 100644 --- a/frontend/src/app/main/data/workspace/selection.cljs +++ b/frontend/src/app/main/data/workspace/selection.cljs @@ -141,6 +141,16 @@ (update-in state [:workspace-local :selected] disj id)))) (defn shift-select-shapes + ([id objects] + (ptk/reify ::shift-select-shapes + ptk/UpdateEvent + (update [_ state] + (let [selection (-> state + wsh/lookup-selected + (conj id))] + (-> state + (assoc-in [:workspace-local :selected] + (cph/expand-region-selection objects selection))))))) ([id] (ptk/reify ::shift-select-shapes ptk/UpdateEvent diff --git a/frontend/src/app/main/ui/workspace/sidebar/layers.cljs b/frontend/src/app/main/ui/workspace/sidebar/layers.cljs index c6248642b..05f6f26a7 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/layers.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/layers.cljs @@ -86,7 +86,7 @@ (when (seq (:touched shape)) " *")]))) (mf/defc layer-item - [{:keys [index item selected objects sortable?] :as props}] + [{:keys [index item selected objects sortable? filtered?] :as props}] (let [id (:id item) blocked? (:blocked item) hidden? (:hidden item) @@ -137,13 +137,15 @@ select-shape (mf/use-fn - (mf/deps id) + (mf/deps id filtered? objects) (fn [event] (dom/prevent-default event) (reset! scroll-to-middle? false) (cond (kbd/shift? event) - (st/emit! (dw/shift-select-shapes id)) + (if filtered? + (st/emit! (dw/shift-select-shapes id objects)) + (st/emit! (dw/shift-select-shapes id))) (kbd/mod? event) (st/emit! (dw/select-shape id true)) @@ -296,7 +298,7 @@ (mf/defc layers-tree {::mf/wrap [#(mf/memo % =) #(mf/throttle % 200)]} - [{:keys [objects] :as props}] + [{:keys [objects filtered?] :as props}] (let [selected (mf/deref refs/selected-shapes) selected (hooks/use-equal-memo selected) root (get objects uuid/zero)] @@ -311,14 +313,16 @@ :index index :objects objects :key id - :sortable? true}] + :sortable? true + :filtered? filtered?}] [:& layer-item {:item obj :selected selected :index index :objects objects :key id - :sortable? true}])))]])) + :sortable? true + :filtered? filtered?}])))]])) (mf/defc filters-tree {::mf/wrap [#(mf/memo % =) @@ -336,7 +340,8 @@ :index index :objects objects :key id - :sortable? false}]))])) + :sortable? false + :filtered? true}]))])) (defn calc-reparented-objects @@ -562,15 +567,22 @@ filter-component) - (when (some? filtered-objects) - [:div.tool-window-content {:ref on-render-container :key "filters"} - [:& filters-tree {:objects filtered-objects - :key (dm/str (:id page))}] - [:div.lazy {:ref lazy-load-ref - :key "lazy-load" - :style {:min-height 16}}]]) + (if (some? filtered-objects) + [:* + [:div.tool-window-content {:ref on-render-container :key "filters"} + [:& filters-tree {:objects filtered-objects + :key (dm/str (:id page))}] + [:div.lazy {:ref lazy-load-ref + :key "lazy-load" + :style {:min-height 16}}]] + [:div.tool-window-content {:on-scroll on-scroll + :style {:display (when (some? filtered-objects) "none")}} + [:& layers-tree {:objects filtered-objects + :key (dm/str (:id page)) + :filtered? true}]]] [:div.tool-window-content {:on-scroll on-scroll :style {:display (when (some? filtered-objects) "none")}} [:& layers-tree {:objects objects - :key (dm/str (:id page))}]]])) + :key (dm/str (:id page)) + :filtered? false}]])]))