Fix undo/redo rendering bugs, and minimise redundant draw calls.