mirror of
https://github.com/penpot/penpot.git
synced 2025-02-08 08:09:14 -05:00
🐛 Fix change color on imported svg also changes the stroke alignment
This commit is contained in:
parent
a5ba9d113f
commit
a861691ffd
3 changed files with 37 additions and 2 deletions
|
@ -35,7 +35,8 @@
|
||||||
- Fix "Attribute overrides in copies are not exported in zip file" [Taiga #8072](https://tree.taiga.io/project/penpot/issue/8072)
|
- Fix "Attribute overrides in copies are not exported in zip file" [Taiga #8072](https://tree.taiga.io/project/penpot/issue/8072)
|
||||||
- Fix group not automatically selected in the Layers panel after creation [Taiga #8078](https://tree.taiga.io/project/penpot/issue/8078)
|
- Fix group not automatically selected in the Layers panel after creation [Taiga #8078](https://tree.taiga.io/project/penpot/issue/8078)
|
||||||
- Fix export boards loses opacity [Taiga #7592](https://tree.taiga.io/project/penpot/issue/7592)
|
- Fix export boards loses opacity [Taiga #7592](https://tree.taiga.io/project/penpot/issue/7592)
|
||||||
- Fix show in view mode and interactions workflow [Taiga #4711](https://github.com/penpot/penpot/pull/4711)
|
- Fix show in view mode and interactions workflow
|
||||||
|
- Fix change color on imported svg also changes the stroke alignment[Taiga #7673](https://github.com/penpot/penpot/pull/7673)
|
||||||
|
|
||||||
## 2.0.3
|
## 2.0.3
|
||||||
|
|
||||||
|
|
|
@ -248,7 +248,7 @@
|
||||||
(assoc :stroke-style :solid)
|
(assoc :stroke-style :solid)
|
||||||
|
|
||||||
(not (contains? new-attrs :stroke-alignment))
|
(not (contains? new-attrs :stroke-alignment))
|
||||||
(assoc :stroke-alignment :inner)
|
(assoc :stroke-alignment :center)
|
||||||
|
|
||||||
:always
|
:always
|
||||||
(d/without-nils))]
|
(d/without-nils))]
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
[app.common.test-helpers.files :as cthf]
|
[app.common.test-helpers.files :as cthf]
|
||||||
[app.common.test-helpers.ids-map :as cthi]
|
[app.common.test-helpers.ids-map :as cthi]
|
||||||
[app.common.test-helpers.shapes :as cths]
|
[app.common.test-helpers.shapes :as cths]
|
||||||
|
[app.main.data.workspace.colors :as dc]
|
||||||
[app.main.data.workspace.shapes :as dwsh]
|
[app.main.data.workspace.shapes :as dwsh]
|
||||||
[cljs.test :as t :include-macros true]
|
[cljs.test :as t :include-macros true]
|
||||||
[frontend-tests.helpers.state :as ths]))
|
[frontend-tests.helpers.state :as ths]))
|
||||||
|
@ -46,3 +47,36 @@
|
||||||
(t/is (= (count fills') 1))
|
(t/is (= (count fills') 1))
|
||||||
(t/is (= (:fill-color fill') "#fabada"))
|
(t/is (= (:fill-color fill') "#fabada"))
|
||||||
(t/is (= (:fill-opacity fill') 1))))))))
|
(t/is (= (:fill-opacity fill') 1))))))))
|
||||||
|
|
||||||
|
(t/deftest test-update-stroke
|
||||||
|
;; Old shapes without stroke-alignment are rendered as if it is centered
|
||||||
|
(t/async
|
||||||
|
done
|
||||||
|
(let [;; ==== Setup
|
||||||
|
store
|
||||||
|
(ths/setup-store
|
||||||
|
(-> (cthf/sample-file :file1 :page-label :page1)
|
||||||
|
(cths/add-sample-shape :shape1 :strokes [{:stroke-color "#000000"
|
||||||
|
:stroke-opacity 1
|
||||||
|
:stroke-width 2}])))
|
||||||
|
|
||||||
|
;; ==== Action
|
||||||
|
events
|
||||||
|
[(dc/change-stroke #{(cthi/id :shape1)} {:color "#FABADA"} 0)]]
|
||||||
|
|
||||||
|
(ths/run-store
|
||||||
|
store done events
|
||||||
|
(fn [new-state]
|
||||||
|
(let [;; ==== Get
|
||||||
|
shape1' (get-in new-state [:workspace-data
|
||||||
|
:pages-index
|
||||||
|
(cthi/id :page1)
|
||||||
|
:objects
|
||||||
|
(cthi/id :shape1)])
|
||||||
|
stroke' (-> (:strokes shape1')
|
||||||
|
first)]
|
||||||
|
|
||||||
|
;; ==== Check
|
||||||
|
(println stroke')
|
||||||
|
(t/is (some? shape1'))
|
||||||
|
(t/is (= (:stroke-alignment stroke') :center))))))))
|
Loading…
Add table
Reference in a new issue