Add custom cursor on editor canvas
This commit is contained in:
parent
77e8218d1f
commit
5322944ad9
2 changed files with 8 additions and 0 deletions
BIN
public/webapp/cursor.png
Normal file
BIN
public/webapp/cursor.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 719 B |
|
@ -44,6 +44,14 @@ export class PluginEditor {
|
||||||
iconProvider: new MaterialIconProvider(),
|
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.dispatch(this.editor.setBackgroundStyle({ autoresize: true }), false);
|
||||||
this.editor.getRootElement().style.height = '100%';
|
this.editor.getRootElement().style.height = '100%';
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue