From 55752d361f52b7c95a3d1d1f827d01a109fa3582 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 30 Dec 2025 11:37:51 +0100 Subject: [PATCH] :bug: Fix problem with path editor and right click --- CHANGES.md | 1 + .../main/ui/workspace/shapes/path/editor.cljs | 43 ++++++++++--------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9be19f2411..56dc7ae04e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ - Fix setting a portion of text as bold or underline messes things up [Github #7980](https://github.com/penpot/penpot/issues/7980) - Fix problem with style in fonts input [Taiga #12935](https://tree.taiga.io/project/penpot/issue/12935) +- Fix problem with path editor and right click [Github #7917](https://github.com/penpot/penpot/issues/7917) ## 2.12.0 diff --git a/frontend/src/app/main/ui/workspace/shapes/path/editor.cljs b/frontend/src/app/main/ui/workspace/shapes/path/editor.cljs index f6d308183b..e93327313d 100644 --- a/frontend/src/app/main/ui/workspace/shapes/path/editor.cljs +++ b/frontend/src/app/main/ui/workspace/shapes/path/editor.cljs @@ -65,34 +65,35 @@ on-pointer-down (fn [event] - (dom/stop-propagation event) - (dom/prevent-default event) + (when (dom/left-mouse? event) + (dom/stop-propagation event) + (dom/prevent-default event) - ;; FIXME: revisit this, using meta here breaks equality checks - (when (and is-new (some? (meta position))) - (st/emit! (drp/create-node-at-position (meta position)))) + ;; FIXME: revisit this, using meta here breaks equality checks + (when (and is-new (some? (meta position))) + (st/emit! (drp/create-node-at-position (meta position)))) - (let [is-shift (kbd/shift? event) - is-mod (kbd/mod? event)] - (cond - is-last - (st/emit! (drp/reset-last-handler)) + (let [is-shift (kbd/shift? event) + is-mod (kbd/mod? event)] + (cond + is-last + (st/emit! (drp/reset-last-handler)) - (and is-move is-mod (not is-curve)) - (st/emit! (drp/make-curve position)) + (and is-move is-mod (not is-curve)) + (st/emit! (drp/make-curve position)) - (and is-move is-mod is-curve) - (st/emit! (drp/make-corner position)) + (and is-move is-mod is-curve) + (st/emit! (drp/make-corner position)) - is-move - ;; If we're dragging a selected item we don't change the selection - (st/emit! (drp/start-move-path-point position is-shift)) + is-move + ;; If we're dragging a selected item we don't change the selection + (st/emit! (drp/start-move-path-point position is-shift)) - (and is-draw is-start-path) - (st/emit! (drp/start-path-from-point position)) + (and is-draw is-start-path) + (st/emit! (drp/start-path-from-point position)) - (and is-draw (not is-start-path)) - (st/emit! (drp/close-path-drag-start position)))))] + (and is-draw (not is-start-path)) + (st/emit! (drp/close-path-drag-start position))))))] [:g.path-point [:circle.path-point