mirror of
https://github.com/penpot/penpot.git
synced 2025-06-22 14:17:00 +02:00
commit
8b0339bbab
11 changed files with 49 additions and 24 deletions
|
@ -31,6 +31,9 @@
|
||||||
- Fix context menu outside screen [Taiga #5524](https://tree.taiga.io/project/penpot/issue/5524)
|
- Fix context menu outside screen [Taiga #5524](https://tree.taiga.io/project/penpot/issue/5524)
|
||||||
- Fix graphic item rename on assets pannel [Taiga #5556](https://tree.taiga.io/project/penpot/issue/5556)
|
- Fix graphic item rename on assets pannel [Taiga #5556](https://tree.taiga.io/project/penpot/issue/5556)
|
||||||
- Fix component and media name validation on assets panel [Taiga #5555](https://tree.taiga.io/project/penpot/issue/5555)
|
- Fix component and media name validation on assets panel [Taiga #5555](https://tree.taiga.io/project/penpot/issue/5555)
|
||||||
|
- Fix problem with selection shortcuts [Taiga #5492](https://tree.taiga.io/project/penpot/issue/5492)
|
||||||
|
- Fix issue with paths line to curve and concurrent editing [Taiga #5191](https://tree.taiga.io/project/penpot/issue/5191)
|
||||||
|
- Fix problems with locked layers [Taiga #5139](https://tree.taiga.io/project/penpot/issue/5139)
|
||||||
|
|
||||||
### :heart: Community contributions by (Thank you!)
|
### :heart: Community contributions by (Thank you!)
|
||||||
|
|
||||||
|
|
|
@ -50,12 +50,15 @@
|
||||||
|
|
||||||
(defn update-curve-to
|
(defn update-curve-to
|
||||||
[command h1 h2]
|
[command h1 h2]
|
||||||
(-> command
|
(let [params {:x (-> command :params :x)
|
||||||
(assoc :command :curve-to)
|
:y (-> command :params :y)
|
||||||
(assoc-in [:params :c1x] (:x h1))
|
:c1x (:x h1)
|
||||||
(assoc-in [:params :c1y] (:y h1))
|
:c1y (:y h1)
|
||||||
(assoc-in [:params :c2x] (:x h2))
|
:c2x (:x h2)
|
||||||
(assoc-in [:params :c2y] (:y h2))))
|
:c2y (:y h2)}]
|
||||||
|
(-> command
|
||||||
|
(assoc :command :curve-to)
|
||||||
|
(assoc :params params))))
|
||||||
|
|
||||||
(defn make-curve-to
|
(defn make-curve-to
|
||||||
[to h1 h2]
|
[to h1 h2]
|
||||||
|
|
|
@ -260,7 +260,11 @@
|
||||||
|
|
||||||
(let [frame-ids (cond->> (all-frames-by-position objects position)
|
(let [frame-ids (cond->> (all-frames-by-position objects position)
|
||||||
(some? excluded)
|
(some? excluded)
|
||||||
(remove excluded))
|
(remove excluded)
|
||||||
|
|
||||||
|
:always
|
||||||
|
(remove #(or (dm/get-in objects [% :hidden])
|
||||||
|
(dm/get-in objects [% :blocked]))))
|
||||||
|
|
||||||
frame-set (set frame-ids)]
|
frame-set (set frame-ids)]
|
||||||
|
|
||||||
|
@ -276,7 +280,10 @@
|
||||||
"Search the top nested frame in a list of ids"
|
"Search the top nested frame in a list of ids"
|
||||||
[objects ids]
|
[objects ids]
|
||||||
|
|
||||||
(let [frame-ids (->> ids (filter #(cph/frame-shape? objects %)))
|
(let [frame-ids (->> ids
|
||||||
|
(filter #(cph/frame-shape? objects %))
|
||||||
|
(remove #(or (dm/get-in objects [% :hidden])
|
||||||
|
(dm/get-in objects [% :blocked]))))
|
||||||
frame-set (set frame-ids)]
|
frame-set (set frame-ids)]
|
||||||
(loop [current-id (first frame-ids)]
|
(loop [current-id (first frame-ids)]
|
||||||
(let [current-shape (get objects current-id)
|
(let [current-shape (get objects current-id)
|
||||||
|
|
|
@ -938,7 +938,10 @@
|
||||||
(rx/of (dwe/start-edition-mode id))
|
(rx/of (dwe/start-edition-mode id))
|
||||||
|
|
||||||
(:group :bool :frame)
|
(:group :bool :frame)
|
||||||
(rx/of (dws/select-shapes (into (d/ordered-set) shapes)))
|
(let [shapes-ids (into (d/ordered-set)
|
||||||
|
(remove #(dm/get-in objects [% :hidden]))
|
||||||
|
shapes)]
|
||||||
|
(rx/of (dws/select-shapes shapes-ids)))
|
||||||
|
|
||||||
:svg-raw
|
:svg-raw
|
||||||
nil
|
nil
|
||||||
|
|
|
@ -63,20 +63,22 @@
|
||||||
|
|
||||||
;; Add & select the created shape to the workspace
|
;; Add & select the created shape to the workspace
|
||||||
(rx/concat
|
(rx/concat
|
||||||
(if (= :text (:type shape))
|
(if (or (= :text (:type shape)) (= :frame (:type shape)))
|
||||||
(rx/of (dwu/start-undo-transaction (:id shape)))
|
(rx/of (dwu/start-undo-transaction (:id shape)))
|
||||||
(rx/empty))
|
(rx/empty))
|
||||||
|
|
||||||
(rx/of (dwsh/add-shape shape {:no-select? (= tool :curve)}))
|
(rx/of (dwsh/add-shape shape {:no-select? (= tool :curve)}))
|
||||||
|
|
||||||
(if (= :frame (:type shape))
|
(if (= :frame (:type shape))
|
||||||
(->> (uw/ask! {:cmd :selection/query
|
(rx/concat
|
||||||
:page-id page-id
|
(->> (uw/ask! {:cmd :selection/query
|
||||||
:rect (:selrect shape)
|
:page-id page-id
|
||||||
:include-frames? true
|
:rect (:selrect shape)
|
||||||
:full-frame? true})
|
:include-frames? true
|
||||||
(rx/map #(cph/clean-loops objects %))
|
:full-frame? true})
|
||||||
(rx/map #(dwsh/move-shapes-into-frame (:id shape) %)))
|
(rx/map #(cph/clean-loops objects %))
|
||||||
|
(rx/map #(dwsh/move-shapes-into-frame (:id shape) %)))
|
||||||
|
(rx/of (dwu/commit-undo-transaction (:id shape))))
|
||||||
(rx/empty)))))
|
(rx/empty)))))
|
||||||
|
|
||||||
;; Delay so the mouse event can read the drawing state
|
;; Delay so the mouse event can read the drawing state
|
||||||
|
|
|
@ -249,7 +249,7 @@
|
||||||
(lookup uuid/zero))
|
(lookup uuid/zero))
|
||||||
|
|
||||||
toselect (->> (cph/get-immediate-children objects (:id parent))
|
toselect (->> (cph/get-immediate-children objects (:id parent))
|
||||||
(into (d/ordered-set) (comp (remove :blocked) (map :id))))]
|
(into (d/ordered-set) (comp (remove :hidden) (remove :blocked) (map :id))))]
|
||||||
|
|
||||||
(rx/of (select-shapes toselect))))))
|
(rx/of (select-shapes toselect))))))
|
||||||
|
|
||||||
|
|
|
@ -143,12 +143,14 @@
|
||||||
(cond-> (ctl/grid-layout? objects frame-id)
|
(cond-> (ctl/grid-layout? objects frame-id)
|
||||||
(pcb/update-shapes [frame-id] ctl/assign-cells))))))
|
(pcb/update-shapes [frame-id] ctl/assign-cells))))))
|
||||||
|
|
||||||
(defn move-shapes-into-frame [frame-id shapes]
|
(defn move-shapes-into-frame
|
||||||
|
[frame-id shapes]
|
||||||
(ptk/reify ::move-shapes-into-frame
|
(ptk/reify ::move-shapes-into-frame
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [it state _]
|
(watch [it state _]
|
||||||
(let [page-id (:current-page-id state)
|
(let [page-id (:current-page-id state)
|
||||||
objects (wsh/lookup-page-objects state page-id)
|
objects (wsh/lookup-page-objects state page-id)
|
||||||
|
shapes (->> shapes (remove #(dm/get-in objects [% :blocked])))
|
||||||
changes (-> (pcb/empty-changes it page-id)
|
changes (-> (pcb/empty-changes it page-id)
|
||||||
(pcb/with-objects objects))
|
(pcb/with-objects objects))
|
||||||
changes (prepare-move-shapes-into-frame changes
|
changes (prepare-move-shapes-into-frame changes
|
||||||
|
|
|
@ -196,7 +196,7 @@
|
||||||
(-> (update-in [:svg-attrs :style] dissoc :mix-blend-mode)
|
(-> (update-in [:svg-attrs :style] dissoc :mix-blend-mode)
|
||||||
(assoc :blend-mode (-> (get-in shape [:svg-attrs :style :mix-blend-mode]) assert-valid-blend-mode)))))
|
(assoc :blend-mode (-> (get-in shape [:svg-attrs :style :mix-blend-mode]) assert-valid-blend-mode)))))
|
||||||
|
|
||||||
(defn create-raw-svg [name frame-id svg-data {:keys [tag attrs] :as data}]
|
(defn create-raw-svg [name frame-id svg-data {:keys [attrs] :as data}]
|
||||||
(let [{:keys [x y width height offset-x offset-y]} svg-data]
|
(let [{:keys [x y width height offset-x offset-y]} svg-data]
|
||||||
(-> {:id (uuid/next)
|
(-> {:id (uuid/next)
|
||||||
:type :svg-raw
|
:type :svg-raw
|
||||||
|
@ -206,7 +206,6 @@
|
||||||
:height height
|
:height height
|
||||||
:x x
|
:x x
|
||||||
:y y
|
:y y
|
||||||
:hidden (= tag :defs)
|
|
||||||
:content (cond-> data
|
:content (cond-> data
|
||||||
(map? data) (update :attrs usvg/clean-attrs))}
|
(map? data) (update :attrs usvg/clean-attrs))}
|
||||||
(assoc :svg-attrs attrs)
|
(assoc :svg-attrs attrs)
|
||||||
|
@ -437,6 +436,7 @@
|
||||||
children (cond->> (:content element-data)
|
children (cond->> (:content element-data)
|
||||||
(contains? usvg/parent-tags tag)
|
(contains? usvg/parent-tags tag)
|
||||||
(mapv #(usvg/inherit-attributes attrs %)))]
|
(mapv #(usvg/inherit-attributes attrs %)))]
|
||||||
|
|
||||||
[shape children]))))))
|
[shape children]))))))
|
||||||
|
|
||||||
(defn create-svg-children
|
(defn create-svg-children
|
||||||
|
@ -537,7 +537,8 @@
|
||||||
root-shape (create-svg-root frame-id parent-id svg-data)
|
root-shape (create-svg-root frame-id parent-id svg-data)
|
||||||
root-id (:id root-shape)
|
root-id (:id root-shape)
|
||||||
|
|
||||||
;; In penpot groups have the size of their children. To respect the imported svg size and empty space let's create a transparent shape as background to respect the imported size
|
;; In penpot groups have the size of their children. To respect the imported
|
||||||
|
;; svg size and empty space let's create a transparent shape as background to respect the imported size
|
||||||
base-background-shape {:tag :rect
|
base-background-shape {:tag :rect
|
||||||
:attrs {:x (str vb-x)
|
:attrs {:x (str vb-x)
|
||||||
:y (str vb-y)
|
:y (str vb-y)
|
||||||
|
@ -588,6 +589,7 @@
|
||||||
|
|
||||||
[new-shape new-children]
|
[new-shape new-children]
|
||||||
(create-svg-shapes svg-data position objects frame-id parent-id selected true)
|
(create-svg-shapes svg-data position objects frame-id parent-id selected true)
|
||||||
|
|
||||||
changes (-> (pcb/empty-changes it page-id)
|
changes (-> (pcb/empty-changes it page-id)
|
||||||
(pcb/with-objects objects)
|
(pcb/with-objects objects)
|
||||||
(pcb/add-object new-shape))
|
(pcb/add-object new-shape))
|
||||||
|
|
|
@ -203,6 +203,7 @@
|
||||||
|
|
||||||
ids (into
|
ids (into
|
||||||
(d/ordered-set)
|
(d/ordered-set)
|
||||||
|
(remove #(dm/get-in objects [% :blocked]))
|
||||||
(ctt/sort-z-index objects ids {:bottom-frames? mod?}))
|
(ctt/sort-z-index objects ids {:bottom-frames? mod?}))
|
||||||
|
|
||||||
grouped? (fn [id] (contains? #{:group :bool} (get-in objects [id :type])))
|
grouped? (fn [id] (contains? #{:group :bool} (get-in objects [id :type])))
|
||||||
|
|
|
@ -149,7 +149,9 @@
|
||||||
text-pos-x (if (:use-for-thumbnail? frame) 15 0)]
|
text-pos-x (if (:use-for-thumbnail? frame) 15 0)]
|
||||||
|
|
||||||
(when (not (:hidden frame))
|
(when (not (:hidden frame))
|
||||||
[:g.frame-title {:id (dm/str "frame-title-" (:id frame)) :transform (vwu/title-transform frame zoom)}
|
[:g.frame-title {:id (dm/str "frame-title-" (:id frame))
|
||||||
|
:transform (vwu/title-transform frame zoom)
|
||||||
|
:pointer-events (when (:blocked frame) "none")}
|
||||||
(when (:use-for-thumbnail? frame)
|
(when (:use-for-thumbnail? frame)
|
||||||
[:svg {:x 0
|
[:svg {:x 0
|
||||||
:y -9
|
:y -9
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
|
|
||||||
:curve-to
|
:curve-to
|
||||||
(let [{:keys [c1x c1y c2x c2y]} params]
|
(let [{:keys [c1x c1y c2x c2y]} params]
|
||||||
(join-params c1x c1y c2x c2y x y))
|
(join-params (or c1x x) (or c1y y) (or c2x x) (or c2y y) x y))
|
||||||
|
|
||||||
(:smooth-curve-to :quadratic-bezier-curve-to)
|
(:smooth-curve-to :quadratic-bezier-curve-to)
|
||||||
(let [{:keys [cx cy]} params]
|
(let [{:keys [cx cy]} params]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue