Margin | | Code
If you create a stroked rectangle on the whole canvas, half the stroke will be clipped. Using translate()
and scale()
you can keep using the same coordinates - you don't have to scale things manually or calculate offsets. Everything will be scaled down, so you can see the whole stroke and it looks like there is a margin.