Fixed resize bug while drawing.