From 7e9f8194d90f4d78ecdbce5c1cb2c7329c85a154 Mon Sep 17 00:00:00 2001 From: liangxu Date: Fri, 17 Jul 2026 11:58:52 +0800 Subject: [PATCH] feat(canvas): update pen tool cursor and add PNG asset --- frontend/public/cursors/pen-tool.png | Bin 0 -> 977 bytes frontend/src/ui/styles.css | 10 +++++----- frontend/tests/editablePath.test.mjs | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 frontend/public/cursors/pen-tool.png diff --git a/frontend/public/cursors/pen-tool.png b/frontend/public/cursors/pen-tool.png new file mode 100644 index 0000000000000000000000000000000000000000..bb67e36f29f008a095afc94a06e8b6f6e7a36b8f GIT binary patch literal 977 zcmV;?11|iDP)^h$3dsLEie`>NuMn~oM4@r^|7B7;wC{M*jdGdMlm3-g5NV*{Dkfe`e`Bf7Eo?tL^ z;eqrOvJw+@rTbTHE?uvk+sf3~d{zxjEo%CvO*d|gNRm>Llk{+jPkW!PRKns#mByIb zSf(Jr00SF0@4)sH^6Ya5a9B1^RlPts91a85gTWBre%DTQO)YEIm64c~!S>3%06j6u zCq*24>+Sb(ST;ZX+%Z+eFwgVj5J3C{=XD3goe_&89Yso{B`eL0xawHPL zomD{T)?EOGO zsVny8X=G$n7k;=TNyFJ$=^7aHYeQ*8Tw_zKvOO7+bbXQ2q4@ZPdi~9JAcdt zQ_?5E?PvabfQ>y@f5TzfRM*r3w2Y07N2>PiCueyHPgd-~?;isA^XPjY;jnDnSp}rH zbFn>z^!D`wY>y=%0f^)*FJaBPGJtWQ6&Q-%cK?Lj=}Kem`mKzOjnmq84yP-PgVjd> zKAmB`q=jBtx9PQ}r!uAy6bfwL#JQ@%OoapWA=V0}b zi3>L~@<|bMfpXvk@G5Z6jLB!2WtLfHxl{ZF5lrTn>p00000NkvXXu0mjft)SoI literal 0 HcmV?d00001 diff --git a/frontend/src/ui/styles.css b/frontend/src/ui/styles.css index 1f8449f..395a0e1 100644 --- a/frontend/src/ui/styles.css +++ b/frontend/src/ui/styles.css @@ -1616,13 +1616,13 @@ button:disabled { } .canvas-stage.is-path-pen-tool, +.canvas-stage.is-path-pen-tool .leafer-canvas-layer, +.canvas-stage.is-path-pen-tool .leafer-canvas-layer > canvas, .canvas-stage.is-path-pen-tool .canvas-world, -.canvas-stage.is-path-pen-tool .canvas-node, -.canvas-stage.is-path-pen-tool .artboard-image, -.canvas-stage.is-path-pen-tool .artboard-preview, +.canvas-stage.is-path-pen-tool .canvas-world *, .canvas-stage.is-path-pen-tool .canvas-path-editor-overlay, -.canvas-stage.is-path-pen-tool .canvas-path-editor-overlay > canvas { - cursor: url("/cursors/pen-tool.svg?v=3") 4 4, default !important; +.canvas-stage.is-path-pen-tool .canvas-path-editor-overlay * { + cursor: url("/cursors/pen-tool.png?v=4") 4 4, default !important; } .canvas-stage.is-text-tool, diff --git a/frontend/tests/editablePath.test.mjs b/frontend/tests/editablePath.test.mjs index bed21e6..1a771b3 100644 --- a/frontend/tests/editablePath.test.mjs +++ b/frontend/tests/editablePath.test.mjs @@ -97,5 +97,7 @@ test("keeps the Pen tool immediately after Shape in the workspace toolbar", asyn assert.doesNotMatch(workspaceSource, /startPenDrawing\(event, true\)/); assert.match(workspaceSource, /key === "p"\) return void run\(\(\) => chooseCanvasTool\("path"\)\)/); assert.match(workspaceSource, /key === "b"\) return void run\(\(\) => chooseCanvasTool\("pen"\)\)/); - assert.match(styles, /cursor:\s*url\("\/cursors\/pen-tool\.svg\?v=3"\) 4 4, default !important;/); + assert.match(styles, /\.canvas-stage\.is-path-pen-tool \.canvas-world \*/); + assert.match(styles, /\.canvas-stage\.is-path-pen-tool \.canvas-path-editor-overlay \*/); + assert.match(styles, /cursor:\s*url\("\/cursors\/pen-tool\.png\?v=4"\) 4 4, default !important;/); });