mirror of
https://github.com/penpot/penpot.git
synced 2026-02-12 22:53:02 +00:00
✨ Improved tests for geom transforms
This commit is contained in:
committed by
Andrey Antukh
parent
8bc37416a0
commit
1fb5ffb59b
@@ -102,7 +102,6 @@
|
||||
(let [calc-extremities
|
||||
(fn [command prev]
|
||||
(case (:command command)
|
||||
:close-path []
|
||||
:move-to [(command->point command)]
|
||||
|
||||
;; If it's a line we add the beginning point and endpoint
|
||||
@@ -116,7 +115,8 @@
|
||||
(curve-extremities (command->point prev)
|
||||
(command->point command)
|
||||
(command->point command :c1)
|
||||
(command->point command :c2)))))
|
||||
(command->point command :c2)))
|
||||
[]))
|
||||
|
||||
extremities (mapcat calc-extremities
|
||||
content
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
[app.common.geom.shapes.common :as gco]))
|
||||
|
||||
(defn rect->points [{:keys [x y width height]}]
|
||||
(assert (number? x))
|
||||
(assert (number? y))
|
||||
(assert (and (number? width) (> width 0)))
|
||||
(assert (and (number? height) (> height 0)))
|
||||
[(gpt/point x y)
|
||||
(gpt/point (+ x width) y)
|
||||
(gpt/point (+ x width) (+ y height))
|
||||
|
||||
Reference in New Issue
Block a user