fix a bug when zooming main-window