Add custom cursor on editor canvas

This commit is contained in:
MassiveBox 2025-05-07 21:16:50 +02:00
parent 77e8218d1f
commit 5322944ad9
Signed by: massivebox
GPG key ID: 9B74D3A59181947D
2 changed files with 8 additions and 0 deletions

BIN
public/webapp/cursor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

View file

@ -44,6 +44,14 @@ export class PluginEditor {
iconProvider: new MaterialIconProvider(),
});
const styleElement = document.createElement('style');
styleElement.innerHTML = `
canvas.wetInkCanvas {
cursor: url('/plugins/siyuan-jsdraw-plugin/webapp/cursor.png') 6 6, auto;
}
`;
this.element.appendChild(styleElement);
this.editor.dispatch(this.editor.setBackgroundStyle({ autoresize: true }), false);
this.editor.getRootElement().style.height = '100%';