Merge pull request #6954 from penpot/alotor-fix-gradient-stroke

🐛 Fix opacity on stroke gradients
This commit is contained in:
Andrey Antukh 2025-07-24 08:59:02 +02:00 committed by GitHub
commit 3f9a1525ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 7 deletions

View File

@ -48,6 +48,8 @@
- Fix "Copy as SVG" generates different code from the Inspect panel [Taiga #11519](https://tree.taiga.io/project/penpot/issue/11519)
- Fix overriden tokens in text copies are not preserved [Taiga #11486](https://tree.taiga.io/project/penpot/issue/11486)
- Fix problem when changing between flex/grid layout [Taiga #11625](https://tree.taiga.io/project/penpot/issue/11625)
- Fix opacity on stroke gradients [Taiga #11646](https://tree.taiga.io/project/penpot/issue/11646)
- Fix change from gradient to solid color [Taiga #11648](https://tree.taiga.io/project/penpot/issue/11648)
## 2.8.1 (Unreleased)

View File

@ -1080,7 +1080,11 @@
(fn [state]
(-> state
(assoc :type :color)
(dissoc :editing-stop :stops :gradient)))))))
(dissoc :editing-stop :stops :gradient)))))
ptk/WatchEvent
(watch [_ _ _]
(rx/of (update-colorpicker-color {} false)))))
(defn activate-colorpicker-gradient
[type]

View File

@ -103,15 +103,15 @@
(obj/set! attrs "strokeWidth" width)
(when (some? gradient)
(if (some? gradient)
(let [gradient-id (dm/str "stroke-color-gradient-" render-id "-" index)]
(obj/set! attrs "stroke" (str/ffmt "url(#%)" gradient-id))))
(obj/set! attrs "stroke" (str/ffmt "url(#%)" gradient-id)))
(when-not (some? gradient)
(when (some? color)
(obj/set! attrs "stroke" color))
(when (some? opacity)
(obj/set! attrs "strokeOpacity" opacity)))
(obj/set! attrs "stroke" color)))
(when (some? opacity)
(obj/set! attrs "strokeOpacity" opacity))
(when (not= style :svg)
(obj/set! attrs "strokeDasharray" (calculate-dasharray style width)))