0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-25 16:25:56 -05:00

Merge pull request #3515 from penpot/niwinz-develop-bugfixes-3

🐛 Fix incorrect position data calculation on generating thumbnails
This commit is contained in:
Alejandro 2023-08-10 10:59:55 +02:00 committed by GitHub
commit b3f62d8a82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View file

@ -484,7 +484,11 @@
(contains? object :masked-group?) (contains? object :masked-group?)
(-> (assoc :masked-group (:masked-group? object)) (-> (assoc :masked-group (:masked-group? object))
(dissoc :masked-group?)))) (dissoc :masked-group?))
(contains? object :saved-component-root?)
(-> (assoc :saved-component-root (:saved-component-root? object))
(dissoc :saved-component-root?))))
(update-container [container] (update-container [container]
(d/update-when container :objects update-vals update-object))] (d/update-when container :objects update-vals update-object))]

View file

@ -313,7 +313,7 @@
(update shape :bool-content gpa/transform-content transform-mtx) (update shape :bool-content gpa/transform-content transform-mtx)
shape) shape)
shape (if (= type :text) shape (if (= type :text)
(update shape :position-data move-position-data transform-mtx) (update shape :position-data transform-position-data transform-mtx)
shape) shape)
shape (if (= type :path) shape (if (= type :path)
(update shape :content gpa/transform-content transform-mtx) (update shape :content gpa/transform-content transform-mtx)
@ -337,7 +337,7 @@
;; NOTE: ensure we have a fresh shallow copy of shape ;; NOTE: ensure we have a fresh shallow copy of shape
shape (cr/clone shape) shape (cr/clone shape)
shape (adjust-shape-flips! shape points) shape (adjust-shape-flips! shape points)
center (gco/points->center points) center (gco/points->center points)
selrect (calculate-selrect points center) selrect (calculate-selrect points center)
transform (calculate-transform points center selrect) transform (calculate-transform points center selrect)

View file

@ -425,7 +425,10 @@
parent-id (or parent-id frame-id) parent-id (or parent-id frame-id)
name (:name obj) name (:name obj)
is-component-root? (or (:saved-component-root? obj) (ctk/instance-root? obj)) is-component-root? (or (:saved-component-root obj)
;; Backward compatibility
(:saved-component-root? obj)
(ctk/instance-root? obj))
duplicating-component? (or duplicating-component? (ctk/instance-head? obj)) duplicating-component? (or duplicating-component? (ctk/instance-head? obj))
is-component-main? (ctk/main-instance? obj) is-component-main? (ctk/main-instance? obj)
regenerate-component regenerate-component