https://openbrush.app/ logo
Clearing Contents on a a layer then undoing causes...
# open-brush-bugs
w
Expected behavior: Undoing Clear Contents should restore the canvas to the exact state it was in immediately before Clear Contents was executed. Strokes that had previously been erased should remain erased unless the erase operation itself is undone. Undo/redo should never produce a canvas state that did not previously exist in the history. Actual behavior: After using Clear Contents and then Undo, previously erased strokes are restored. In some cases this creates a canvas state that never actually existed: for example, if a stroke is drawn, erased, and then redrawn, undoing Clear Contents restores both the erased original and the replacement stroke simultaneously. I'm using an original HTC Vive with SteamVR https://cdn.discordapp.com/attachments/1521193176474583111/1521193177225101464/OBUBsmall.mp4?ex=6a43f10b&is=6a429f8b&hm=d2ae9ac21d927a6927280d7354518af4e904f2237e0ee527814051d02daa3493&
a
brilliantly helpful bug report. I'm aware of a bunch of bugs with layers but I just haven't had the time to narrow down how to reproduce them this is really useful. thanks!
w
Glad it's useful. Honestly it was an interesting insight into how the system works. Since this is possible, I'm curious-do erased strokes still take up RAM forever? Or is there a point where they drop off the Undo list and get cleaned up? Or am I totally misunderstanding how things work under the hood?
a
the only thing that truly clears them is restarting the app. they don't take up vast amounts of RAM and we're banking on the fact that people aren't doing crazy long sessions without a break
w
Wait, even starting a new sketch doesn't actually take the old one out of memory? It that an architectural limitation or just something that wasn't worth the developer time to fix?
a
oh - i think it does. i can't remember for sure without checking
85% sure 🙂
w
Don't worry about checking(unless you're also curious) - seems like a good excuse for me to look at the source code lol
a
The current beta hopefully fixes this and also a bug I spotted at the same time when you undo then redo "add layer"
If you have a moment to test this in the beta then let me know if it's fixed for you: https://docs.openbrush.app/alternate-and-experimental-builds/open-brush-beta-docs
w
fixed! Thank you so much.
All good on my system
RE: clearing memory, per https://github.com/icosa-foundation/open-brush/blob/main/Assets/Scripts/SketchControlsScript.cs it looks like
NewSketch
calls
SketchMemoryScript.m_Instance.ClearMemory();
so I guess it does properly clear.
2 Views