I want to understand what's the correct way to scale shapes of bezier curves for
different screen sizes. Say, I've made an icon for a UIButton
using UIBezierPath
like this:
UIBezierPath* rectanglePath = [UIBezierPath bezierPath];
[rectanglePath moveToPoint: CGPointMake(6, 23)];
[rectanglePath addLineToPoint: CGPointMake(23, 23)];
[rectanglePath addLineToPoint: CGPointMake(23, 6)];
[rectanglePath addLineToPoint: CGPointMake(6, 6)];
[rectanglePath addLineToPoint: CGPointMake(6, 23)];
[rectanglePath closePath];
[UIColor.grayColor setFill];
[rectanglePath fill];
The coordinates have absolute values. How should scale this shape for different screen sizes?
Do I have to parametrize the coordinates? I see this approach as difficult because shapes can be very complex.
Or maybe I can apply some kind of transformation to a
UIBezierPath
to scale it to a size the corresponds to the screen size?Or do I have to create the code with bezier paths for each screen size and take it when needed?
Three options and I'm not sure which one is the correct.. Or maybe there is another option which I don't know yet?