mirror of
https://github.com/penpot/penpot.git
synced 2025-06-05 04:51:39 +02:00
🐛 Fix problem with booleans and new fills/strokes
This commit is contained in:
parent
a588267fc2
commit
9c00de047a
2 changed files with 10 additions and 6 deletions
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
(ns app.common.path.shapes-to-path
|
(ns app.common.path.shapes-to-path
|
||||||
(:require
|
(:require
|
||||||
|
[app.common.colors :as clr]
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
[app.common.geom.matrix :as gmt]
|
[app.common.geom.matrix :as gmt]
|
||||||
[app.common.geom.point :as gpt]
|
[app.common.geom.point :as gpt]
|
||||||
|
@ -38,6 +39,7 @@
|
||||||
:fill-color-ref-file
|
:fill-color-ref-file
|
||||||
:fill-color-ref-id
|
:fill-color-ref-id
|
||||||
:fill-image
|
:fill-image
|
||||||
|
:fills
|
||||||
:stroke-color
|
:stroke-color
|
||||||
:stroke-color-ref-file
|
:stroke-color-ref-file
|
||||||
:stroke-color-ref-id
|
:stroke-color-ref-id
|
||||||
|
@ -46,7 +48,10 @@
|
||||||
:stroke-width
|
:stroke-width
|
||||||
:stroke-alignment
|
:stroke-alignment
|
||||||
:stroke-cap-start
|
:stroke-cap-start
|
||||||
:stroke-cap-end]))
|
:stroke-cap-end
|
||||||
|
:strokes]))
|
||||||
|
|
||||||
|
(def default-bool-fills [{:fill-color clr/black}])
|
||||||
|
|
||||||
(defn make-corner-arc
|
(defn make-corner-arc
|
||||||
"Creates a curvle corner for border radius"
|
"Creates a curvle corner for border radius"
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
(ns app.main.data.workspace.bool
|
(ns app.main.data.workspace.bool
|
||||||
(:require
|
(:require
|
||||||
[app.common.colors :as clr]
|
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
[app.common.geom.shapes :as gsh]
|
[app.common.geom.shapes :as gsh]
|
||||||
[app.common.pages.changes-builder :as cb]
|
[app.common.pages.changes-builder :as cb]
|
||||||
|
@ -35,8 +34,8 @@
|
||||||
(let [shapes (mapv #(stp/convert-to-path % objects) shapes)
|
(let [shapes (mapv #(stp/convert-to-path % objects) shapes)
|
||||||
head (if (= bool-type :difference) (first shapes) (last shapes))
|
head (if (= bool-type :difference) (first shapes) (last shapes))
|
||||||
head (cond-> head
|
head (cond-> head
|
||||||
(and (contains? head :svg-attrs) (nil? (:fill-color head)))
|
(and (contains? head :svg-attrs) (empty? (:fills head)))
|
||||||
(assoc :fill-color clr/black))
|
(assoc :fills stp/default-bool-fills))
|
||||||
|
|
||||||
head-data (select-keys head stp/style-properties)
|
head-data (select-keys head stp/style-properties)
|
||||||
|
|
||||||
|
@ -61,8 +60,8 @@
|
||||||
(mapv #(stp/convert-to-path % objects)))
|
(mapv #(stp/convert-to-path % objects)))
|
||||||
head (if (= bool-type :difference) (first shapes) (last shapes))
|
head (if (= bool-type :difference) (first shapes) (last shapes))
|
||||||
head (cond-> head
|
head (cond-> head
|
||||||
(and (contains? head :svg-attrs) (nil? (:fill-color head)))
|
(and (contains? head :svg-attrs) (empty? (:fills head)))
|
||||||
(assoc :fill-color clr/black))
|
(assoc :fills stp/default-bool-fills))
|
||||||
head-data (select-keys head stp/style-properties)]
|
head-data (select-keys head stp/style-properties)]
|
||||||
|
|
||||||
(-> group
|
(-> group
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue