0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-28 15:41:25 -05:00

Merge pull request #5169 from penpot/alotor-bugfixing4

🐛 Fix problem with inner strokes bounds
This commit is contained in:
Andrey Antukh 2024-10-15 13:02:53 +02:00 committed by GitHub
commit 9170c70f2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,6 +10,7 @@
[app.common.data.macros :as dm]
[app.common.files.helpers :as cfh]
[app.common.geom.rect :as grc]
[app.common.geom.shapes :as gsh]
[app.common.math :as mth]))
(defn shape-stroke-margin
@ -97,12 +98,15 @@
([shape ignore-margin?]
(let [strokes (:strokes shape)
open-path? (and ^boolean (cfh/path-shape? shape)
^boolean (gsh/open-path? shape))
stroke-width
(->> strokes
(map #(case (get % :stroke-alignment :center)
:center (/ (:stroke-width % 0) 2)
:outer (:stroke-width % 0)
(:stroke-width % 0)))
(if open-path? (:stroke-width % 0) 0)))
(reduce d/max 0))
stroke-margin