mirror of
https://github.com/penpot/penpot.git
synced 2026-09-11 22:49:30 +00:00
Merge pull request #5169 from penpot/alotor-bugfixing4
🐛 Fix problem with inner strokes bounds
This commit is contained in:
commit
9170c70f2a
@ -10,6 +10,7 @@
|
|||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
[app.common.files.helpers :as cfh]
|
[app.common.files.helpers :as cfh]
|
||||||
[app.common.geom.rect :as grc]
|
[app.common.geom.rect :as grc]
|
||||||
|
[app.common.geom.shapes :as gsh]
|
||||||
[app.common.math :as mth]))
|
[app.common.math :as mth]))
|
||||||
|
|
||||||
(defn shape-stroke-margin
|
(defn shape-stroke-margin
|
||||||
@ -97,12 +98,15 @@
|
|||||||
([shape ignore-margin?]
|
([shape ignore-margin?]
|
||||||
(let [strokes (:strokes shape)
|
(let [strokes (:strokes shape)
|
||||||
|
|
||||||
|
open-path? (and ^boolean (cfh/path-shape? shape)
|
||||||
|
^boolean (gsh/open-path? shape))
|
||||||
|
|
||||||
stroke-width
|
stroke-width
|
||||||
(->> strokes
|
(->> strokes
|
||||||
(map #(case (get % :stroke-alignment :center)
|
(map #(case (get % :stroke-alignment :center)
|
||||||
:center (/ (:stroke-width % 0) 2)
|
:center (/ (:stroke-width % 0) 2)
|
||||||
:outer (:stroke-width % 0)
|
:outer (:stroke-width % 0)
|
||||||
(:stroke-width % 0)))
|
(if open-path? (:stroke-width % 0) 0)))
|
||||||
(reduce d/max 0))
|
(reduce d/max 0))
|
||||||
|
|
||||||
stroke-margin
|
stroke-margin
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user