Is there any way to draw lines in CGContext which connected with each other with 45 degree angle, like this picture shows:
I don't think there is a simple way to do it. If there were, it would be one of the options you could pass to CGContextSetLineCap
, but it only supports Butt, Round, and Square.
What you would need to do is write a function that takes two end points, a direction (so you know which side to make smaller), and a color. Use this info to draw a filled-in trapezoid.