mirror of
https://github.com/penpot/penpot.git
synced 2025-06-15 10:31:39 +02:00
🐛 Fix unwanted warnings on first shape drawing.
This commit is contained in:
parent
b29aac5d5f
commit
5289268156
4 changed files with 8 additions and 4 deletions
|
@ -768,6 +768,7 @@
|
||||||
(update $ :transform-inverse #(gmt/multiply stretch-matrix-inverse (or % (gmt/matrix))))
|
(update $ :transform-inverse #(gmt/multiply stretch-matrix-inverse (or % (gmt/matrix))))
|
||||||
(assoc $ :points (shape->points $))
|
(assoc $ :points (shape->points $))
|
||||||
(assoc $ :selrect (points->selrect (:points $)))
|
(assoc $ :selrect (points->selrect (:points $)))
|
||||||
|
(update $ :selrect fix-invalid-rect-values)
|
||||||
(update $ :rotation #(mod (+ % (get-in $ [:modifiers :rotation] 0)) 360))
|
(update $ :rotation #(mod (+ % (get-in $ [:modifiers :rotation] 0)) 360))
|
||||||
|
|
||||||
)]
|
)]
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
[uxbox.main.store :as st]
|
[uxbox.main.store :as st]
|
||||||
[uxbox.main.ui.workspace.shapes :as shapes]
|
[uxbox.main.ui.workspace.shapes :as shapes]
|
||||||
[uxbox.common.geom.shapes :as gsh]
|
[uxbox.common.geom.shapes :as gsh]
|
||||||
|
[uxbox.common.data :as d]
|
||||||
[uxbox.util.dom :as dom]
|
[uxbox.util.dom :as dom]
|
||||||
[uxbox.util.i18n :as i18n :refer [t]]))
|
[uxbox.util.i18n :as i18n :refer [t]]))
|
||||||
|
|
||||||
|
@ -28,8 +29,11 @@
|
||||||
|
|
||||||
(mf/defc generic-draw-area
|
(mf/defc generic-draw-area
|
||||||
[{:keys [shape zoom]}]
|
[{:keys [shape zoom]}]
|
||||||
(let [{:keys [x y width height]} (:selrect (gsh/transform-shape shape))]
|
(let [{:keys [x y width height] :as kk} (:selrect (gsh/transform-shape shape))]
|
||||||
(when (and x y)
|
(when (and x y
|
||||||
|
(not (d/nan? x))
|
||||||
|
(not (d/nan? y)))
|
||||||
|
|
||||||
[:g
|
[:g
|
||||||
[:& shapes/shape-wrapper {:shape shape}]
|
[:& shapes/shape-wrapper {:shape shape}]
|
||||||
[:rect.main {:x x :y y
|
[:rect.main {:x x :y y
|
||||||
|
|
|
@ -198,7 +198,7 @@
|
||||||
:on-resize (partial on-resize position)
|
:on-resize (partial on-resize position)
|
||||||
:transform transform
|
:transform transform
|
||||||
:rotation (:rotation shape)}
|
:rotation (:rotation shape)}
|
||||||
props (->> props (merge common-props) map->obj)]
|
props (map->obj (merge common-props props))]
|
||||||
(case type
|
(case type
|
||||||
:rotation (when (not= :frame (:type shape)) [:> rotation-handler props])
|
:rotation (when (not= :frame (:type shape)) [:> rotation-handler props])
|
||||||
:resize-point [:> resize-point-handler props]
|
:resize-point [:> resize-point-handler props]
|
||||||
|
|
|
@ -86,7 +86,6 @@
|
||||||
:editor editor
|
:editor editor
|
||||||
:attrs converted-attrs}))
|
:attrs converted-attrs}))
|
||||||
text-ids)))))]
|
text-ids)))))]
|
||||||
(prn "fill-menu" ids values)
|
|
||||||
(if show?
|
(if show?
|
||||||
[:div.element-set
|
[:div.element-set
|
||||||
[:div.element-set-title
|
[:div.element-set-title
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue