mirror of
https://github.com/penpot/penpot.git
synced 2025-02-12 18:18:24 -05:00
📎 Fix common tests.
This commit is contained in:
parent
10e7d660ef
commit
261724e555
2 changed files with 7 additions and 8 deletions
|
@ -181,11 +181,10 @@
|
|||
shape-before (-> (create-test-shape type {:modifiers modifiers})
|
||||
(assoc :selrect selrect))
|
||||
shape-after (gsh/transform-shape shape-before {:round-coords? false})]
|
||||
|
||||
(= (:selrect shape-before)
|
||||
(:selrect shape-after)))
|
||||
|
||||
:rect {:x 0 :y 0 :x1 0 :y1 0 :x2 ##Inf :y2 ##Inf :width ##Inf :height ##Inf}
|
||||
:path {:x 0 :y 0 :x1 0 :y1 0 :x2 ##Inf :y2 ##Inf :width ##Inf :height ##Inf}
|
||||
:rect {:x 0.0 :y 0.0 :x1 0.0 :y1 0.0 :x2 ##Inf :y2 ##Inf :width ##Inf :height ##Inf}
|
||||
:path {:x 0.0 :y 0.0 :x1 0.0 :y1 0.0 :x2 ##Inf :y2 ##Inf :width ##Inf :height ##Inf}
|
||||
:rect nil
|
||||
:path nil)))
|
||||
|
|
|
@ -71,21 +71,21 @@
|
|||
|
||||
(t/deftest matrix-constructors-test
|
||||
(let [m (gmt/matrix)]
|
||||
(t/is (= (str m) "matrix(1,0,0,1,0,0)")))
|
||||
(t/is (= (str m) "matrix(1.0,0.0,0.0,1.0,0.0,0.0)")))
|
||||
(let [m (gmt/matrix 1 1 1 2 2 2)]
|
||||
(t/is (= (str m) "matrix(1,1,1,2,2,2)"))))
|
||||
(t/is (= (str m) "matrix(1.0,1.0,1.0,2.0,2.0,2.0)"))))
|
||||
|
||||
(t/deftest matrix-translate-test
|
||||
(let [m (-> (gmt/matrix)
|
||||
(gmt/translate (gpt/point 2 10)))]
|
||||
(t/is (= (str m) "matrix(1,0,0,1,2,10)"))))
|
||||
(t/is (= (str m) "matrix(1.0,0.0,0.0,1.0,2.0,10.0)"))))
|
||||
|
||||
(t/deftest matrix-scale-test
|
||||
(let [m (-> (gmt/matrix)
|
||||
(gmt/scale (gpt/point 2)))]
|
||||
(t/is (= (str m) "matrix(2,0,0,2,0,0)"))))
|
||||
(t/is (= (str m) "matrix(2.0,0.0,0.0,2.0,0.0,0.0)"))))
|
||||
|
||||
(t/deftest matrix-rotate-test
|
||||
(let [m (-> (gmt/matrix)
|
||||
(gmt/rotate 10))]
|
||||
(t/is (= (str m) "matrix(0.984807753012208,0.17364817766693033,-0.17364817766693033,0.984807753012208,0,0)"))))
|
||||
(t/is (= (str m) "matrix(0.984807753012208,0.17364817766693033,-0.17364817766693033,0.984807753012208,0.0,0.0)"))))
|
||||
|
|
Loading…
Add table
Reference in a new issue