mirror of
https://github.com/penpot/penpot.git
synced 2025-05-24 21:46:12 +02:00
🐛 Fix path stroke is not working properly with high thickness
This commit is contained in:
parent
703859ac75
commit
950367b055
2 changed files with 13 additions and 9 deletions
|
@ -35,6 +35,7 @@
|
||||||
- Fix problem with lines and inside/outside stroke [Taiga #2146](https://tree.taiga.io/project/penpot/issue/2146)
|
- Fix problem with lines and inside/outside stroke [Taiga #2146](https://tree.taiga.io/project/penpot/issue/2146)
|
||||||
- Add stroke width in selection calculation [Taiga #2146](https://tree.taiga.io/project/penpot/issue/2146)
|
- Add stroke width in selection calculation [Taiga #2146](https://tree.taiga.io/project/penpot/issue/2146)
|
||||||
- Fix shift+wheel to horizontal scrolling in MacOS [#1217](https://github.com/penpot/penpot/issues/1217)
|
- Fix shift+wheel to horizontal scrolling in MacOS [#1217](https://github.com/penpot/penpot/issues/1217)
|
||||||
|
- Fix path stroke is not working properly with high thickness [Taiga #2154](https://tree.taiga.io/project/penpot/issue/2154)
|
||||||
|
|
||||||
### :arrow_up: Deps updates
|
### :arrow_up: Deps updates
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,14 @@
|
||||||
[rumext.alpha :as mf]))
|
[rumext.alpha :as mf]))
|
||||||
|
|
||||||
(defn- stroke-type->dasharray
|
(defn- stroke-type->dasharray
|
||||||
[style]
|
[width style]
|
||||||
(case style
|
(let [values (case style
|
||||||
:mixed "5,5,1,5"
|
:mixed [5 5 1 5]
|
||||||
:dotted "5,5"
|
:dotted [5 5]
|
||||||
:dashed "10,10"
|
:dashed [10 10]
|
||||||
nil))
|
nil)]
|
||||||
|
|
||||||
|
(->> values (map #(+ % width)) (str/join ","))))
|
||||||
|
|
||||||
(defn- truncate-side
|
(defn- truncate-side
|
||||||
[shape ra-attr rb-attr dimension-attr]
|
[shape ra-attr rb-attr dimension-attr]
|
||||||
|
@ -102,10 +104,11 @@
|
||||||
|
|
||||||
(defn add-stroke [attrs shape render-id]
|
(defn add-stroke [attrs shape render-id]
|
||||||
(let [stroke-style (:stroke-style shape :none)
|
(let [stroke-style (:stroke-style shape :none)
|
||||||
stroke-color-gradient-id (str "stroke-color-gradient_" render-id)]
|
stroke-color-gradient-id (str "stroke-color-gradient_" render-id)
|
||||||
|
stroke-width (:stroke-width shape 1)]
|
||||||
(if (not= stroke-style :none)
|
(if (not= stroke-style :none)
|
||||||
(let [stroke-attrs
|
(let [stroke-attrs
|
||||||
(cond-> {:strokeWidth (:stroke-width shape 1)}
|
(cond-> {:strokeWidth stroke-width}
|
||||||
(:stroke-color-gradient shape)
|
(:stroke-color-gradient shape)
|
||||||
(assoc :stroke (str/format "url(#%s)" stroke-color-gradient-id))
|
(assoc :stroke (str/format "url(#%s)" stroke-color-gradient-id))
|
||||||
|
|
||||||
|
@ -118,7 +121,7 @@
|
||||||
(assoc :strokeOpacity (:stroke-opacity shape nil))
|
(assoc :strokeOpacity (:stroke-opacity shape nil))
|
||||||
|
|
||||||
(not= stroke-style :svg)
|
(not= stroke-style :svg)
|
||||||
(assoc :strokeDasharray (stroke-type->dasharray stroke-style))
|
(assoc :strokeDasharray (stroke-type->dasharray stroke-width stroke-style))
|
||||||
|
|
||||||
;; For simple line caps we use svg stroke-line-cap attribute. This
|
;; For simple line caps we use svg stroke-line-cap attribute. This
|
||||||
;; only works if all caps are the same and we are not using the tricks
|
;; only works if all caps are the same and we are not using the tricks
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue