mirror of
https://github.com/penpot/penpot.git
synced 2025-07-26 03:27:20 +02:00
🐛 Fix send to back several shapes at a time
This commit is contained in:
parent
b904237c5a
commit
3822be76a8
2 changed files with 10 additions and 8 deletions
|
@ -43,6 +43,7 @@
|
||||||
|
|
||||||
### :bug: Bugs fixed
|
### :bug: Bugs fixed
|
||||||
|
|
||||||
|
- Fix send to back several shapes at a time [Taiga #3077](https://tree.taiga.io/project/penpot/issue/3077)
|
||||||
- Fix duplicate multi selected elements [Taiga #3155](https://tree.taiga.io/project/penpot/issue/3155)
|
- Fix duplicate multi selected elements [Taiga #3155](https://tree.taiga.io/project/penpot/issue/3155)
|
||||||
- Fix add fills to artboard modify children [Taiga #3151](https://tree.taiga.io/project/penpot/issue/3151)
|
- Fix add fills to artboard modify children [Taiga #3151](https://tree.taiga.io/project/penpot/issue/3151)
|
||||||
- Avoid numeric inputs to allow big numbers [Taiga #2858](https://tree.taiga.io/project/penpot/issue/2858)
|
- Avoid numeric inputs to allow big numbers [Taiga #2858](https://tree.taiga.io/project/penpot/issue/2858)
|
||||||
|
|
|
@ -578,19 +578,20 @@
|
||||||
(watch [it state _]
|
(watch [it state _]
|
||||||
(let [page-id (:current-page-id state)
|
(let [page-id (:current-page-id state)
|
||||||
objects (wsh/lookup-page-objects state page-id)
|
objects (wsh/lookup-page-objects state page-id)
|
||||||
selected-shapes (->> (wsh/lookup-selected state)
|
selected-ids (wsh/lookup-selected state)
|
||||||
(map (d/getf objects)))
|
selected-shapes (map (d/getf objects) selected-ids)
|
||||||
|
|
||||||
move-shape
|
move-shape
|
||||||
(fn [changes shape]
|
(fn [changes shape]
|
||||||
(let [parent (get objects (:parent-id shape))
|
(let [parent (get objects (:parent-id shape))
|
||||||
sibling-ids (:shapes parent)
|
sibling-ids (:shapes parent)
|
||||||
current-index (d/index-of sibling-ids (:id shape))
|
current-index (d/index-of sibling-ids (:id shape))
|
||||||
|
index-in-selection (d/index-of selected-ids (:id shape))
|
||||||
new-index (case loc
|
new-index (case loc
|
||||||
:top (count sibling-ids)
|
:top (count sibling-ids)
|
||||||
:down (max 0 (- current-index 1))
|
:down (max 0 (- current-index 1))
|
||||||
:up (min (count sibling-ids) (+ (inc current-index) 1))
|
:up (min (count sibling-ids) (+ (inc current-index) 1))
|
||||||
:bottom 0)]
|
:bottom index-in-selection)]
|
||||||
(pcb/change-parent changes
|
(pcb/change-parent changes
|
||||||
(:id parent)
|
(:id parent)
|
||||||
[shape]
|
[shape]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue