Performance improvements

This commit is contained in:
alonso.torres
2022-11-28 13:05:54 +01:00
parent 04243be4a5
commit 600f9ef071
2 changed files with 96 additions and 33 deletions

View File

@@ -0,0 +1,26 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS INC
(ns common-tests.types-modifiers-test
(:require
[clojure.test :as t]
[app.common.geom.matrix :as gmt]
[app.common.geom.point :as gpt]
[app.common.types.modifiers :as ctm]))
(t/deftest test-modifiers->transform
(let [modifiers
(-> (ctm/empty)
(ctm/move (gpt/point 100 200))
(ctm/resize (gpt/point 100 200) (gpt/point 2.0 0.5))
(ctm/move (gpt/point -100 -200))
(ctm/resize (gpt/point 100 200) (gpt/point 2.0 0.5))
(ctm/rotation (gpt/point 0 0) -100)
(ctm/resize (gpt/point 100 200) (gpt/point 2.0 0.5)))
transform (ctm/modifiers->transform modifiers)]
(t/is (not (gmt/close? (gmt/matrix) transform)))))