0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-04 13:29:14 -05:00

Merge pull request #4183 from penpot/niwinz-staging-migration

🐛 Migration fixes (not components related)
This commit is contained in:
Alejandro 2024-02-22 15:01:58 +01:00 committed by GitHub
commit 8cc4ff0b4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 9 deletions

View file

@ -143,10 +143,10 @@
(def ^:private sql:get-files-by-report (def ^:private sql:get-files-by-report
"WITH files AS ( "WITH files AS (
SELECT t.id t.features, mr.name SELECT f.id, f.features, mr.label
FROM migration_file_report AS mr FROM migration_file_report AS mr
JOIN file AS t ON (t.id = mr.file_id) JOIN file AS f ON (f.id = mr.file_id)
WHERE t.deleted_at IS NULL WHERE f.deleted_at IS NULL
AND mr.error IS NOT NULL AND mr.error IS NOT NULL
ORDER BY mr.created_at ORDER BY mr.created_at
) SELECT id, features FROM files %(pred)s") ) SELECT id, features FROM files %(pred)s")

View file

@ -492,9 +492,11 @@
[data] [data]
(some-> cfeat/*new* (swap! conj "fdata/shape-data-type")) (some-> cfeat/*new* (swap! conj "fdata/shape-data-type"))
(letfn [(update-object [object] (letfn [(update-object [object]
(if (cfh/root? object)
object
(-> object (-> object
(d/update-when :selrect grc/make-rect) (update :selrect grc/make-rect)
(cts/map->Shape))) (cts/map->Shape))))
(update-container [container] (update-container [container]
(d/update-when container :objects update-vals update-object))] (d/update-when container :objects update-vals update-object))]
(-> data (-> data

View file

@ -63,10 +63,11 @@
(make-rect x1 y1 (- x2 x1) (- y2 y1)))) (make-rect x1 y1 (- x2 x1) (- y2 y1))))
([x y width height] ([x y width height]
(when (d/num? x y width height) (if (d/num? x y width height)
(let [w (mth/max width 0.01) (let [w (mth/max width 0.01)
h (mth/max height 0.01)] h (mth/max height 0.01)]
(pos->Rect x y w h x y (+ x w) (+ y h)))))) (pos->Rect x y w h x y (+ x w) (+ y h)))
(make-rect))))
(def ^:private schema:rect-attrs (def ^:private schema:rect-attrs
[:map {:title "RectAttrs"} [:map {:title "RectAttrs"}

View file

@ -7,6 +7,7 @@
(ns app.common.geom.shapes.path (ns app.common.geom.shapes.path
(:require (:require
[app.common.data :as d] [app.common.data :as d]
[app.common.data.macros :as dm]
[app.common.geom.matrix :as gmt] [app.common.geom.matrix :as gmt]
[app.common.geom.point :as gpt] [app.common.geom.point :as gpt]
[app.common.geom.rect :as grc] [app.common.geom.rect :as grc]
@ -975,7 +976,7 @@
flip-y (gmt/scale (gpt/point 1 -1)) flip-y (gmt/scale (gpt/point 1 -1))
:always (gmt/multiply (:transform-inverse shape (gmt/matrix)))) :always (gmt/multiply (:transform-inverse shape (gmt/matrix))))
center (or (gco/shape->center shape) center (or (some-> (dm/get-prop shape :selrect) grc/rect->center)
(content-center content)) (content-center content))
base-content (transform-content base-content (transform-content