mirror of
https://github.com/penpot/penpot.git
synced 2025-05-15 07:56:38 +02:00
🐛 Fix problems with empty paths and shortcuts
This commit is contained in:
parent
5e0101e424
commit
3bb3fcfbda
3 changed files with 64 additions and 62 deletions
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
- Fix problem with `close-path` command [#917](https://github.com/penpot/penpot/issues/917)
|
- Fix problem with `close-path` command [#917](https://github.com/penpot/penpot/issues/917)
|
||||||
- Fix wrong query for obtain the profile default project-id
|
- Fix wrong query for obtain the profile default project-id
|
||||||
|
- Fix problems with empty paths and shortcuts [#923](https://github.com/penpot/penpot/issues/923)
|
||||||
|
|
||||||
## 1.5.1-alpha
|
## 1.5.1-alpha
|
||||||
|
|
||||||
|
|
|
@ -30,14 +30,16 @@
|
||||||
id (st/get-path-id state)
|
id (st/get-path-id state)
|
||||||
page-id (:current-page-id state)
|
page-id (:current-page-id state)
|
||||||
shape (get-in state (st/get-path state))
|
shape (get-in state (st/get-path state))
|
||||||
|
|
||||||
selected-points (get-in state [:workspace-local :edit-path id :selected-points] #{})
|
selected-points (get-in state [:workspace-local :edit-path id :selected-points] #{})
|
||||||
points (or points selected-points)
|
points (or points selected-points)]
|
||||||
new-content (-> (tool-fn (:content shape) points)
|
(when-not (empty? points)
|
||||||
|
(let [new-content (-> (tool-fn (:content shape) points)
|
||||||
(ups/close-subpaths))
|
(ups/close-subpaths))
|
||||||
[rch uch] (changes/generate-path-changes objects page-id shape (:content shape) new-content)]
|
[rch uch] (changes/generate-path-changes objects page-id shape (:content shape) new-content)]
|
||||||
(rx/of (dch/commit-changes rch uch {:commit-local? true})
|
(rx/of (dch/commit-changes rch uch {:commit-local? true})
|
||||||
(when (empty? new-content)
|
(when (empty? new-content)
|
||||||
dwc/clear-edition-mode)))))))
|
dwc/clear-edition-mode)))))))))
|
||||||
|
|
||||||
(defn make-corner
|
(defn make-corner
|
||||||
([]
|
([]
|
||||||
|
|
|
@ -8,14 +8,10 @@
|
||||||
(:require
|
(:require
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
[app.common.geom.point :as gpt]
|
[app.common.geom.point :as gpt]
|
||||||
[app.common.geom.shapes.path :as gshp]
|
|
||||||
[app.util.svg :as usvg]
|
|
||||||
[cuerdas.core :as str]
|
|
||||||
[clojure.set :as set]
|
|
||||||
[app.common.math :as mth]
|
[app.common.math :as mth]
|
||||||
[app.util.path.commands :as upc]
|
[app.util.path.commands :as upc]
|
||||||
[app.util.path.geom :as upg]
|
[app.util.path.geom :as upg]
|
||||||
))
|
[clojure.set :as set]))
|
||||||
|
|
||||||
(defn remove-line-curves
|
(defn remove-line-curves
|
||||||
"Remove all curves that have both handlers in the same position that the
|
"Remove all curves that have both handlers in the same position that the
|
||||||
|
@ -235,6 +231,9 @@
|
||||||
to keep everything consistent"
|
to keep everything consistent"
|
||||||
[content points]
|
[content points]
|
||||||
|
|
||||||
|
(if (empty? points)
|
||||||
|
content
|
||||||
|
|
||||||
(let [content (d/with-prev content)]
|
(let [content (d/with-prev content)]
|
||||||
|
|
||||||
(loop [result []
|
(loop [result []
|
||||||
|
@ -298,7 +297,7 @@
|
||||||
(recur result
|
(recur result
|
||||||
cur-handler
|
cur-handler
|
||||||
(first content)
|
(first content)
|
||||||
(rest content)))))))
|
(rest content))))))))
|
||||||
|
|
||||||
(defn join-nodes
|
(defn join-nodes
|
||||||
"Creates new segments between points that weren't previously"
|
"Creates new segments between points that weren't previously"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue