With the last fix of _invalidate, we introduced new issues.
If the _invalidate was called multiple times, it would schedule multiple redraw.
If the _invalidate was called before render, the redraw would fail.
If the _invalidate was called after remove, the redraw would fail.
Fix
Reuse the _scheduleRedraw method to consolidate the redraw. Add an additional parameter to decide whether we should use animation from or simply next tick.
Problem
With the last fix of
_invalidate
, we introduced new issues._invalidate
was called multiple times, it would schedule multiple redraw._invalidate
was called beforerender
, the redraw would fail._invalidate
was called afterremove
, the redraw would fail.Fix
Reuse the
_scheduleRedraw
method to consolidate the redraw. Add an additional parameter to decide whether we should use animation from or simply next tick.