Fixed bug that occurred sometimes when switching between map editing and
log preview mode (2D renderer).