mirror's resize logic