From 23e7116b2475f559bd8142ce96d08bc9adca10ab Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 30 Dec 2025 14:28:10 +0100 Subject: [PATCH 1/3] :bug: Fix problem with style in fonts input --- CHANGES.md | 1 + frontend/src/app/main/ui/dashboard/fonts.cljs | 4 +++- frontend/src/app/main/ui/dashboard/fonts.scss | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index e890be0fc4..9be19f2411 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ ### :bug: Bugs fixed - 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) ## 2.12.0 diff --git a/frontend/src/app/main/ui/dashboard/fonts.cljs b/frontend/src/app/main/ui/dashboard/fonts.cljs index 3e1b421cd0..f84d694893 100644 --- a/frontend/src/app/main/ui/dashboard/fonts.cljs +++ b/frontend/src/app/main/ui/dashboard/fonts.cljs @@ -360,7 +360,9 @@ (st/emit! (modal/show options)))))] [:div {:class (stl/css :font-item :table-row)} - [:div {:class (stl/css :table-field :family)} + [:div {:class (stl/css-case :table-field true + :family true + :is-edition edition?)} (if ^boolean edition? [:input {:type "text" :auto-focus true diff --git a/frontend/src/app/main/ui/dashboard/fonts.scss b/frontend/src/app/main/ui/dashboard/fonts.scss index 8a064213df..f3d195b35b 100644 --- a/frontend/src/app/main/ui/dashboard/fonts.scss +++ b/frontend/src/app/main/ui/dashboard/fonts.scss @@ -126,6 +126,9 @@ @include twoLineTextEllipsis; min-width: $sz-200; width: $sz-200; + &.is-edition { + overflow: visible; + } } > .filenames { From 55752d361f52b7c95a3d1d1f827d01a109fa3582 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 30 Dec 2025 11:37:51 +0100 Subject: [PATCH 2/3] :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 From 6c6b3db87e942bae8f410b5fe5dbdf12bb63e6ac Mon Sep 17 00:00:00 2001 From: Aitor Moreno Date: Fri, 2 Jan 2026 12:33:29 +0100 Subject: [PATCH 3/3] :recycle: Minor naming changes and event handling --- frontend/src/app/render_wasm/api.cljs | 25 +++++++++++++------------ frontend/src/app/render_wasm/wasm.cljs | 17 ++++++++++++----- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/frontend/src/app/render_wasm/api.cljs b/frontend/src/app/render_wasm/api.cljs index a6916d873e..2e135af0bf 100644 --- a/frontend/src/app/render_wasm/api.cljs +++ b/frontend/src/app/render_wasm/api.cljs @@ -40,6 +40,7 @@ ;; FIXME: rename; confunsing name [app.render-wasm.wasm :as wasm] [app.util.debug :as dbg] + [app.util.dom :as dom] [app.util.functions :as fns] [app.util.globals :as ug] [app.util.text.content :as tc] @@ -1229,6 +1230,13 @@ (re-find #"(?i)edge" user-agent) :edge :else :unknown))))) +(defn- on-webgl-context-lost + [event] + (dom/prevent-default event) + (reset! wasm/context-lost? true) + (log/warn :hint "WebGL context lost") + (st/emit! (drw/context-lost))) + (defn init-canvas-context [canvas] (let [gl (unchecked-get wasm/internal-module "GL") @@ -1256,14 +1264,8 @@ (set-canvas-size canvas) ;; Add event listeners for WebGL context lost - (let [handler (fn [event] - (.preventDefault event) - (reset! wasm/context-lost? true) - (log/warn :hint "WebGL context lost") - (st/emit! (drw/context-lost)))] - (set! wasm/context-lost-handler handler) - (set! wasm/context-lost-canvas canvas) - (.addEventListener canvas "webglcontextlost" handler)) + (set! wasm/canvas canvas) + (.addEventListener canvas "webglcontextlost" on-webgl-context-lost) (set! wasm/context-initialized? true))) context-init?)) @@ -1277,10 +1279,9 @@ (h/call wasm/internal-module "_clean_up") ;; Remove event listener for WebGL context lost - (when (and wasm/context-lost-handler wasm/context-lost-canvas) - (.removeEventListener wasm/context-lost-canvas "webglcontextlost" wasm/context-lost-handler) - (set! wasm/context-lost-canvas nil) - (set! wasm/context-lost-handler nil)) + (when wasm/canvas + (.removeEventListener wasm/canvas "webglcontextlost" on-webgl-context-lost) + (set! wasm/canvas nil)) ;; Ensure the WebGL context is properly disposed so browsers do not keep ;; accumulating active contexts between page switches. diff --git a/frontend/src/app/render_wasm/wasm.cljs b/frontend/src/app/render_wasm/wasm.cljs index ef80362956..0f6a0f6c5f 100644 --- a/frontend/src/app/render_wasm/wasm.cljs +++ b/frontend/src/app/render_wasm/wasm.cljs @@ -9,8 +9,20 @@ (defonce internal-frame-id nil) (defonce internal-module #js {}) + +;; Reference to the HTML canvas element. +(defonce canvas nil) + +;; Reference to the Emscripten GL context wrapper. (defonce gl-context-handle nil) + +;; Reference to the actual WebGL Context returned +;; by the `.getContext` method of the canvas. (defonce gl-context nil) + +(defonce context-initialized? false) +(defonce context-lost? (atom false)) + (defonce serializers #js {:blur-type shared/RawBlurType :blend-mode shared/RawBlendMode @@ -44,8 +56,3 @@ :stroke-linecap shared/RawStrokeLineCap :stroke-linejoin shared/RawStrokeLineJoin :fill-rule shared/RawFillRule}) - -(defonce context-initialized? false) -(defonce context-lost? (atom false)) -(defonce context-lost-handler nil) -(defonce context-lost-canvas nil) \ No newline at end of file