mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
⚡ Remove reflection on geom rect code
This commit is contained in:
@@ -255,10 +255,10 @@
|
|||||||
(if-let [pt (first pts)]
|
(if-let [pt (first pts)]
|
||||||
(let [x (dm/get-prop pt :x)
|
(let [x (dm/get-prop pt :x)
|
||||||
y (dm/get-prop pt :y)]
|
y (dm/get-prop pt :y)]
|
||||||
(recur (mth/min minx x)
|
(recur (double (mth/min minx x))
|
||||||
(mth/min miny y)
|
(double (mth/min miny y))
|
||||||
(mth/max maxx x)
|
(double (mth/max maxx x))
|
||||||
(mth/max maxy y)
|
(double (mth/max maxy y))
|
||||||
(rest pts)))
|
(rest pts)))
|
||||||
(when (d/num? minx miny maxx maxy)
|
(when (d/num? minx miny maxx maxy)
|
||||||
(make-rect minx miny (- maxx minx) (- maxy miny)))))))
|
(make-rect minx miny (- maxx minx) (- maxy miny)))))))
|
||||||
|
|||||||
@@ -168,7 +168,7 @@
|
|||||||
(gpt/point 20 65.2)
|
(gpt/point 20 65.2)
|
||||||
(gpt/point 12 -10)]
|
(gpt/point 12 -10)]
|
||||||
result (grc/points->rect points)
|
result (grc/points->rect points)
|
||||||
expect {:x -1, :y -10, :width 21, :height 75.2}]
|
expect {:x -1.0, :y -10.0, :width 21.0, :height 75.2}]
|
||||||
|
|
||||||
(t/is (= (:x expect) (:x result)))
|
(t/is (= (:x expect) (:x result)))
|
||||||
(t/is (= (:y expect) (:y result)))
|
(t/is (= (:y expect) (:y result)))
|
||||||
|
|||||||
Reference in New Issue
Block a user