Bounding-box optimization for drawing