mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 18:16:12 +02:00
🐛 Fix problem with snap-pixel on resize
This commit is contained in:
parent
48615ca5b2
commit
d2a5344407
2 changed files with 11 additions and 2 deletions
|
@ -74,6 +74,15 @@
|
||||||
(mth/close? (.-e m1) (.-e m2))
|
(mth/close? (.-e m1) (.-e m2))
|
||||||
(mth/close? (.-f m1) (.-f m2))))
|
(mth/close? (.-f m1) (.-f m2))))
|
||||||
|
|
||||||
|
(defn unit? [m1]
|
||||||
|
(and (some? m1)
|
||||||
|
(mth/close? (.-a m1) 1)
|
||||||
|
(mth/close? (.-b m1) 0)
|
||||||
|
(mth/close? (.-c m1) 0)
|
||||||
|
(mth/close? (.-d m1) 1)
|
||||||
|
(mth/close? (.-e m1) 0)
|
||||||
|
(mth/close? (.-f m1) 0)))
|
||||||
|
|
||||||
(defn multiply
|
(defn multiply
|
||||||
([^Matrix m1 ^Matrix m2]
|
([^Matrix m1 ^Matrix m2]
|
||||||
(let [m1a (.-a m1)
|
(let [m1a (.-a m1)
|
||||||
|
|
|
@ -282,9 +282,9 @@
|
||||||
|
|
||||||
(defn set-pixel-precision
|
(defn set-pixel-precision
|
||||||
"Adjust modifiers so they adjust to the pixel grid"
|
"Adjust modifiers so they adjust to the pixel grid"
|
||||||
[modifiers shape]
|
[{:keys [resize-transform] :as modifiers} shape]
|
||||||
|
|
||||||
(if (some? (:resize-transform modifiers))
|
(if (and (some? resize-transform) (not (gmt/unit? resize-transform)))
|
||||||
;; If we're working with a rotation we don't handle pixel precision because
|
;; If we're working with a rotation we don't handle pixel precision because
|
||||||
;; the transformation won't have the precision anyway
|
;; the transformation won't have the precision anyway
|
||||||
modifiers
|
modifiers
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue