Merge pull request #6011 from penpot/palba-fix-cut-paste-copy

🐛 Fix cut and paste a copy inside its parent
This commit is contained in:
Alejandro 2025-03-06 07:16:51 +01:00 committed by GitHub
commit 8488be311e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -17,6 +17,7 @@
- Fix opacity in frame containers [Github #5858](https://github.com/penpot/penpot/pull/5858) - Fix opacity in frame containers [Github #5858](https://github.com/penpot/penpot/pull/5858)
- Avoid resizing on click [Taiga #10213](https://tree.taiga.io/project/penpot/issue/10213) - Avoid resizing on click [Taiga #10213](https://tree.taiga.io/project/penpot/issue/10213)
- Hide horizontal scroll from dashboard sidebar [Taiga #10422](https://tree.taiga.io/project/penpot/issue/10422) - Hide horizontal scroll from dashboard sidebar [Taiga #10422](https://tree.taiga.io/project/penpot/issue/10422)
- Fix cut and paste a copy a cmponent inside its parent [Taiga #10365](https://tree.taiga.io/project/penpot/us/10365)
## 2.5.2 ## 2.5.2

View file

@ -501,7 +501,12 @@
(defn- invalid-structure-for-component? (defn- invalid-structure-for-component?
"Check if the structure generated nesting children in parent is invalid in terms of nested components" "Check if the structure generated nesting children in parent is invalid in terms of nested components"
[objects parent children pasting? libraries] [objects parent children pasting? libraries]
(let [; When we are pasting, the main shapes will be pasted as copies, unless the (let [; If the original shapes had been cutted, and we are pasting them now, they aren't
; in objects. We can add them to locate later
objects (merge objects
(into {} (map (juxt :id identity) children)))
; When we are pasting, the main shapes will be pasted as copies, unless the
; original component doesn't exist or is deleted. So for this function purposes, they ; original component doesn't exist or is deleted. So for this function purposes, they
; are removed from the list ; are removed from the list
remove? (fn [shape] remove? (fn [shape]