mirror of
https://github.com/penpot/penpot.git
synced 2025-05-24 01:06:10 +02:00
🐛 Fix stroke cut on shapes export
This commit is contained in:
parent
5e6719e22e
commit
eed75bcbda
3 changed files with 16 additions and 14 deletions
|
@ -202,17 +202,12 @@
|
|||
:height (- y2 y1)})))))
|
||||
|
||||
(defn calculate-padding [shape]
|
||||
(let [{:keys [stroke-style stroke-alignment stroke-width]} shape]
|
||||
(cond
|
||||
(and (not= stroke-style :none)
|
||||
(= stroke-alignment :outer))
|
||||
stroke-width
|
||||
|
||||
(and (not= stroke-style :none)
|
||||
(= stroke-alignment :center))
|
||||
(mth/ceil (/ stroke-width 2))
|
||||
|
||||
:else 0)))
|
||||
(let [stroke-width (case (:stroke-alignment shape :center)
|
||||
:center (/ (:stroke-width shape 0) 2)
|
||||
:outer (:stroke-width shape 0)
|
||||
0)
|
||||
margin (gsh/shape-stroke-margin shape stroke-width)]
|
||||
(+ stroke-width margin)))
|
||||
|
||||
(mf/defc filters
|
||||
[{:keys [filter-id shape]}]
|
||||
|
@ -221,9 +216,7 @@
|
|||
|
||||
;; Adds the previous filter as `filter-in` parameter
|
||||
filters (map #(assoc %1 :filter-in %2) filters (cons nil (map :id filters)))
|
||||
|
||||
bounds (get-filters-bounds shape filters (or (-> shape :blur :value) 0))
|
||||
|
||||
padding (calculate-padding shape)]
|
||||
|
||||
[:*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue