Fixed drawing bug related to resizing