0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-10 14:51:37 -05:00

🐛 Fix unwanted warnings on first shape drawing.

This commit is contained in:
Andrey Antukh 2020-08-10 12:38:26 +02:00 committed by Hirunatan
parent b29aac5d5f
commit 5289268156
4 changed files with 8 additions and 4 deletions

View file

@ -768,6 +768,7 @@
(update $ :transform-inverse #(gmt/multiply stretch-matrix-inverse (or % (gmt/matrix))))
(assoc $ :points (shape->points $))
(assoc $ :selrect (points->selrect (:points $)))
(update $ :selrect fix-invalid-rect-values)
(update $ :rotation #(mod (+ % (get-in $ [:modifiers :rotation] 0)) 360))
)]

View file

@ -13,6 +13,7 @@
[uxbox.main.store :as st]
[uxbox.main.ui.workspace.shapes :as shapes]
[uxbox.common.geom.shapes :as gsh]
[uxbox.common.data :as d]
[uxbox.util.dom :as dom]
[uxbox.util.i18n :as i18n :refer [t]]))
@ -28,8 +29,11 @@
(mf/defc generic-draw-area
[{:keys [shape zoom]}]
(let [{:keys [x y width height]} (:selrect (gsh/transform-shape shape))]
(when (and x y)
(let [{:keys [x y width height] :as kk} (:selrect (gsh/transform-shape shape))]
(when (and x y
(not (d/nan? x))
(not (d/nan? y)))
[:g
[:& shapes/shape-wrapper {:shape shape}]
[:rect.main {:x x :y y

View file

@ -198,7 +198,7 @@
:on-resize (partial on-resize position)
:transform transform
:rotation (:rotation shape)}
props (->> props (merge common-props) map->obj)]
props (map->obj (merge common-props props))]
(case type
:rotation (when (not= :frame (:type shape)) [:> rotation-handler props])
:resize-point [:> resize-point-handler props]

View file

@ -86,7 +86,6 @@
:editor editor
:attrs converted-attrs}))
text-ids)))))]
(prn "fill-menu" ids values)
(if show?
[:div.element-set
[:div.element-set-title