🐛 Fix strokes don't update correctly

This commit is contained in:
Alejandro Alonso 2025-01-10 15:12:05 +01:00 committed by Andrey Antukh
parent 3af44641de
commit 642b6b1621
6 changed files with 95 additions and 65 deletions

View file

@ -48,7 +48,7 @@
(t/is (= (:fill-color fill') "#fabada"))
(t/is (= (:fill-opacity fill') 1))))))))
(t/deftest test-update-stroke
(t/deftest test-update-stroke-color
;; Old shapes without stroke-alignment are rendered as if it is centered
(t/async
done
@ -62,7 +62,7 @@
;; ==== Action
events
[(dc/change-stroke #{(cthi/id :shape1)} {:color "#FABADA"} 0)]]
[(dc/change-stroke-color #{(cthi/id :shape1)} {:color "#FABADA"} 0)]]
(ths/run-store
store done events
@ -77,6 +77,8 @@
first)]
;; ==== Check
(println stroke')
;; (println stroke')
(t/is (some? shape1'))
(t/is (= (:stroke-alignment stroke') :inner))))))))
(t/is (= (:stroke-alignment stroke') :inner))
(t/is (= (:stroke-color stroke') "#FABADA"))
(t/is (= (:stroke-width stroke') 2))))))))

View file

@ -23,11 +23,9 @@
_ (set! st/state store)
context (api/create-context "TEST")
page (. context -currentPage)
shape (.createRectangle context)
^js context (api/create-context "TEST")
^js page (. context -currentPage)
^js shape (.createRectangle context)
get-shape-path
#(vector :workspace-data :pages-index (aget page "$id") :objects (aget shape "$id") %)]