zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
3.68k stars 202 forks source link

BUG: Hardware Eraser Support script stays on eraser when combined with auto draw for pen #1112

Open devinat1 opened 1 year ago

devinat1 commented 1 year ago

Your environment SYSTEM INFO: Obsidian version: v1.1.16 Installer version: v1.1.9 Operating system: Windows 10 Home 10.0.22621 Login status: logged in Catalyst license: none Insider build toggle: off Live preview: on Legacy editor: off Base theme: dark Community theme: Minimal v6.3.2 Snippets enabled: 0 Restricted mode: off Plugins installed: 21 Plugins enabled: 15 1: Image Toolkit v1.3.1 2: Mousewheel Image zoom v1.0.17 3: Dataview v0.5.55 4: Readwise Official v2.0.1 5: Templater v1.16.0 6: Obsidian_to_Anki v3.4.2 7: Excalidraw v1.8.26 8: Editor Syntax Highlight v0.1.3 9: Highlightr v1.2.2 10: Paste URL into selection v1.7.0 11: Admonition v9.2.3 12: Google Photos v1.2.3 13: ExcaliBrain v0.1.12 14: Text Extractor v0.4.3 15: Find orphaned files and broken links v1.9.0

Describe the bug When I use the hardware eraser, then go back to drawing with both auto draw for pen and hardware eraser support enabled, when I erase then try drawing again, the option stays at the eraser.

Expected behavior Go back to the pen from the eraser. Otherwise, it breaks the flow of using the pen like a pen.

Additional context Using microsoft surface pen 2 on a surface pro 8 running windows 11

zsviczian commented 1 year ago

Hi @threethan, can you take a look at this?

viniciusdel commented 10 months ago

I'm also experiencing this issue.

xieve commented 8 months ago

I have this issue when two instances of the Hardware Eraser script are running at the same time. Sometimes the script stops working (when I press the button, the pen nither draws nor erases). When I try to run the script again, the bug described in this issue occurs.

Seems like the Hardware eraser script crashes when a file is closed that it was running on.

Console says:

Uncaught TypeError: Cannot read properties of null (reading 'getAppState')
    at handlePointer (eval at executeScript (plugin:obsidian-excalidraw-plugin:1:1), <anonymous>:23:49)

It also seems as though this script was running in every tab, not just Excalidraw.