Draw a donut with iOSPath

I’m trying to draw a simple donut using iOSPath, unfortunately it seems I can’t combine two paths or substract a path to another one.

[code] Const PI = 3.141592653589

Dim x, y As Double
x = g.Width/2
y = g.Height/2

Dim path As New iOSPath
path.MoveToPoint(g.Width-1, g.Height/2)
path.AddArc(x, y, 5, 0, 2PI, True) //inner circle
path.AddArc(x, y, g.Width/2-1, 0, 2
PI, True) //outer circle

g.FillColor = &cFF0000

The result is a filled circle as if I were to use g.FillOval

Any hints ?

I guess it has to do with the lack of the CGPathFillRule in Xojo’s FillPath command.
You should declare into CGContext/CoreGraphics (or use a solution that does so).

Thanks for the tip!
I’ll use a picture instead as this is for a radio button with fixed size.

Oh right. I built my own classes with native CGMutablePaths to handle this, which works on iOS and macOS. I just still could not publish it because I had to find a way to fix upside down (and way too big) text when I used the deprecated DrawString command on macOS. Maybe I’ll find a few hours to finish this project between the years. Enables PDF drawing and creation via graphics commands too. </Promo off>