0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-11 01:28:30 -05:00

🐛 Fix a worker error when transforming a rectangle into path

This commit is contained in:
alonso.torres 2021-11-05 15:42:49 +01:00 committed by Andrés Moya
parent b6b6b6043c
commit 959c998664
3 changed files with 18 additions and 20 deletions

View file

@ -21,6 +21,7 @@
- Fix problem with text rendering on export [Taiga #2223](https://tree.taiga.io/project/penpot/issue/2223)
- Fix problem when flattening booleans losing styles [Taiga #2217](https://tree.taiga.io/project/penpot/issue/2217)
- Add shortcuts to boolean icons popups [Taiga #2220](https://tree.taiga.io/project/penpot/issue/2220)
- Fix a worker error when transforming a rectangle into path
### :arrow_up: Deps updates
### :heart: Community contributions by (Thank you!)

View file

@ -6,6 +6,7 @@
(ns app.common.geom.shapes.intersect
(:require
[app.common.data :as d]
[app.common.geom.matrix :as gmt]
[app.common.geom.point :as gpt]
[app.common.geom.shapes.path :as gpp]
@ -172,6 +173,7 @@
"Checks if the given rect overlaps with the path in any point"
[shape rect]
(when (d/not-empty? (:content shape))
(let [ ;; If paths are too complex the intersection is too expensive
;; we fallback to check its bounding box otherwise the performance penalty
;; is too big
@ -187,7 +189,7 @@
(or (is-point-inside-nonzero? (first rect-points) path-lines)
(is-point-inside-nonzero? start-point rect-lines)
(intersects-lines? rect-lines path-lines))))
(intersects-lines? rect-lines path-lines)))))
(defn is-point-inside-ellipse?
"checks if a point is inside an ellipse"

View file

@ -177,12 +177,7 @@
(map #(get objects %))
(map #(convert-to-path % objects)))
bool-type (:bool-type shape)
head (if (= bool-type :difference) (first children) (last children))
head (cond-> head
(and (contains? head :svg-attrs) (nil? (:fill-color head)))
(assoc :fill-color "#000000"))
content (pb/content-bool (:bool-type shape) (mapv :content children))]
content (pb/content-bool bool-type (mapv :content children))]
(-> shape
(assoc :type :path)