mirror of
https://github.com/penpot/penpot.git
synced 2025-05-19 22:06:10 +02:00
🐛 Fix ordering of copy+pasted shapes after rect select
This commit is contained in:
parent
2974fb0f4e
commit
c62905b9a8
3 changed files with 9 additions and 5 deletions
|
@ -28,6 +28,7 @@
|
||||||
- Fix problem with pan and space [#811](https://github.com/penpot/penpot/issues/811)
|
- Fix problem with pan and space [#811](https://github.com/penpot/penpot/issues/811)
|
||||||
- Fix issue when parsing exponential numbers in paths
|
- Fix issue when parsing exponential numbers in paths
|
||||||
- Remove legacy system user and team [#843](https://github.com/penpot/penpot/issues/843)
|
- Remove legacy system user and team [#843](https://github.com/penpot/penpot/issues/843)
|
||||||
|
- Fix ordering of copy pasted objects [Taiga #1618](https://tree.taiga.io/project/penpot/issue/1617)
|
||||||
- Fix problems with blending modes [#837](https://github.com/penpot/penpot/issues/837)
|
- Fix problems with blending modes [#837](https://github.com/penpot/penpot/issues/837)
|
||||||
- Fix problem with zoom an selection rect [#845](https://github.com/penpot/penpot/issues/845)
|
- Fix problem with zoom an selection rect [#845](https://github.com/penpot/penpot/issues/845)
|
||||||
- Fix problem displaying team statistics [#859](https://github.com/penpot/penpot/issues/859)
|
- Fix problem displaying team statistics [#859](https://github.com/penpot/penpot/issues/859)
|
||||||
|
|
|
@ -100,7 +100,8 @@
|
||||||
{:cmd :selection/query
|
{:cmd :selection/query
|
||||||
:page-id page-id
|
:page-id page-id
|
||||||
:rect rect
|
:rect rect
|
||||||
:include-frames? true}))))
|
:include-frames? true
|
||||||
|
:reverse? true})))) ;; we want the topmost shape to be selected first
|
||||||
|
|
||||||
;; We use ref so we don't recreate the stream on a change
|
;; We use ref so we don't recreate the stream on a change
|
||||||
transform-ref (mf/use-ref nil)
|
transform-ref (mf/use-ref nil)
|
||||||
|
|
|
@ -41,8 +41,8 @@
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
(defmethod impl/handler :selection/query
|
(defmethod impl/handler :selection/query
|
||||||
[{:keys [page-id rect frame-id include-frames? include-groups? disabled-masks] :or {include-groups? true
|
[{:keys [page-id rect frame-id include-frames? include-groups? disabled-masks reverse?]
|
||||||
disabled-masks #{}} :as message}]
|
:or {include-groups? true disabled-masks #{} reverse? false} :as message}]
|
||||||
(when-let [index (get @state page-id)]
|
(when-let [index (get @state page-id)]
|
||||||
(let [result (-> (qdt/search index (clj->js rect))
|
(let [result (-> (qdt/search index (clj->js rect))
|
||||||
(es6-iterator-seq))
|
(es6-iterator-seq))
|
||||||
|
@ -76,11 +76,13 @@
|
||||||
(filter (comp overlaps? :frame))
|
(filter (comp overlaps? :frame))
|
||||||
(filter (comp overlaps-masks? :masks))
|
(filter (comp overlaps-masks? :masks))
|
||||||
(filter overlaps?))
|
(filter overlaps?))
|
||||||
result)]
|
result)
|
||||||
|
|
||||||
|
keyfn (if reverse? (comp - :z) :z)]
|
||||||
|
|
||||||
(into (d/ordered-set)
|
(into (d/ordered-set)
|
||||||
(->> matching-shapes
|
(->> matching-shapes
|
||||||
(sort-by (comp - :z))
|
(sort-by keyfn)
|
||||||
(map :id))))))
|
(map :id))))))
|
||||||
|
|
||||||
(defn create-mask-index
|
(defn create-mask-index
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue