mirror of
https://github.com/penpot/penpot.git
synced 2025-05-26 00:56:09 +02:00
🐛 Fix radial gradients
This commit is contained in:
parent
94405ab72d
commit
043c038dae
1 changed files with 3 additions and 1 deletions
|
@ -36,7 +36,9 @@
|
||||||
(mf/defc radial-gradient [{:keys [id gradient shape]}]
|
(mf/defc radial-gradient [{:keys [id gradient shape]}]
|
||||||
(let [{:keys [x y width height]} (:selrect shape)
|
(let [{:keys [x y width height]} (:selrect shape)
|
||||||
center (gsh/center-shape shape)
|
center (gsh/center-shape shape)
|
||||||
transform (when (= :path (:type shape)) (gsh/transform-matrix shape))]
|
transform (if (= :path (:type shape))
|
||||||
|
(gsh/transform-matrix shape)
|
||||||
|
(gmt/matrix))]
|
||||||
(let [[x y] (if (= (:type shape) :frame) [0 0] [x y])
|
(let [[x y] (if (= (:type shape) :frame) [0 0] [x y])
|
||||||
translate-vec (gpt/point (+ x (* width (:start-x gradient)))
|
translate-vec (gpt/point (+ x (* width (:start-x gradient)))
|
||||||
(+ y (* height (:start-y gradient))))
|
(+ y (* height (:start-y gradient))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue