scaling-corner
✓ Published0🌍 Public
11wheel
Last edited Feb 13, 2018
Created on Feb 13, 2018
Two rounded rectangles scale vertically in a looping animation, while dashed circles mark their corners. The left rectangle stretches with its corner radius fixed, while the right rectangle divides its `ry` value by the scale factor to keep the corner arcs visually circular. Built with d3.timer and SVG transforms, the example demonstrates how to adjust a shape’s radius when applying non-uniform scaling.
AI-generated descriptionTo keep the radius of a round rectangle constant when the y scaling is adjusted, divide the ry property by the scaling.
Here, the scale is scale(1, ${s}), so ry is set to r/s.