0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-24 07:46:13 -05:00

Merge pull request #1665 from penpot/fix/bool-with-multiple-shapes

🐛 Fix problem with booleans and new fills/strokes
This commit is contained in:
Alejandro 2022-03-08 10:02:20 +01:00 committed by GitHub
commit 43cbe2dd39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View file

@ -6,6 +6,7 @@
(ns app.common.path.shapes-to-path
(:require
[app.common.colors :as clr]
[app.common.data :as d]
[app.common.geom.matrix :as gmt]
[app.common.geom.point :as gpt]
@ -38,6 +39,7 @@
:fill-color-ref-file
:fill-color-ref-id
:fill-image
:fills
:stroke-color
:stroke-color-ref-file
:stroke-color-ref-id
@ -46,7 +48,10 @@
:stroke-width
:stroke-alignment
:stroke-cap-start
:stroke-cap-end]))
:stroke-cap-end
:strokes]))
(def default-bool-fills [{:fill-color clr/black}])
(defn make-corner-arc
"Creates a curvle corner for border radius"

View file

@ -6,7 +6,6 @@
(ns app.main.data.workspace.bool
(:require
[app.common.colors :as clr]
[app.common.data :as d]
[app.common.geom.shapes :as gsh]
[app.common.pages.changes-builder :as cb]
@ -35,8 +34,8 @@
(let [shapes (mapv #(stp/convert-to-path % objects) shapes)
head (if (= bool-type :difference) (first shapes) (last shapes))
head (cond-> head
(and (contains? head :svg-attrs) (nil? (:fill-color head)))
(assoc :fill-color clr/black))
(and (contains? head :svg-attrs) (empty? (:fills head)))
(assoc :fills stp/default-bool-fills))
head-data (select-keys head stp/style-properties)
@ -61,8 +60,8 @@
(mapv #(stp/convert-to-path % objects)))
head (if (= bool-type :difference) (first shapes) (last shapes))
head (cond-> head
(and (contains? head :svg-attrs) (nil? (:fill-color head)))
(assoc :fill-color clr/black))
(and (contains? head :svg-attrs) (empty? (:fills head)))
(assoc :fills stp/default-bool-fills))
head-data (select-keys head stp/style-properties)]
(-> group