0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-25 06:01:46 -05:00

🐛 Fix :bool path handling on setup-shape

This commit is contained in:
Andrey Antukh 2023-10-18 13:08:01 +02:00
parent 0547eebf85
commit da0f51c5a6
3 changed files with 18 additions and 3 deletions

View file

@ -6,4 +6,4 @@
(ns app.common.files.defaults)
(def version 33)
(def version 34)

View file

@ -624,3 +624,17 @@
(update container :objects update-vals update-object))]
(-> data
(update :pages-index update-vals update-container))))
(defmethod migrate 34
[data]
(letfn [(update-object [object]
(if (or (cph/path-shape? object)
(cph/bool-shape? object))
(dissoc object :x :y :width :height)
object))
(update-container [container]
(update container :objects update-vals update-object))]
(-> data
(update :pages-index update-vals update-container)
(update :components update-vals update-container))))

View file

@ -433,7 +433,8 @@
attrs (get-minimal-shape type)]
(cond-> attrs
(not= :path type)
(and (not= :path type)
(not= :bool type))
(-> (assoc :x 0)
(assoc :y 0)
(assoc :width 0.01)
@ -481,7 +482,7 @@
(let [shape (make-minimal-shape type)
shape (merge shape (d/without-nils props))
shape (case (:type shape)
:path (setup-path shape)
(:bool :path) (setup-path shape)
:image (-> shape setup-rect setup-image)
(setup-rect shape))]
(-> shape