Clean up the cursor preview when it is removed from its parent

This commit is contained in:
DD 2018-01-11 18:50:42 -05:00
parent 136357463c
commit 8439a6387e

View file

@ -163,7 +163,12 @@ class Blobbiness {
if (!this.options) {
return;
}
if (this.cursorPreview && this.cursorPreview.parent &&
// The cursor preview was unattached from the view by an outside process,
// such as changing costumes or undo.
if (this.cursorPreview && !this.cursorPreview.parent) {
this.cursorPreview = null;
}
if (this.cursorPreview &&
this.brushSize === this.options.brushSize &&
this.fillColor === this.options.fillColor &&
this.strokeColor === this.options.strokeColor &&