I must be missing something but whenever I try to use a GraphicsPath object, it wants to set y=0 exactly halfway down the canvas. I don’t see this documented anywhere, but I don’t see anybody complaining about it either, which makes me wonder if there is somewhere something I’ve set wrong somehow.
Anyways, simply code in a canvas paint method:
[code]Var gp As New GraphicsPath
g.AntiAlias = True
//some regular lines
g.DrawingColor = &cffffff
g.FillRectangle(5,5,g.Width-10,g.Height-10)
g.DrawingColor = &c000000
g.DrawLine(g.Width/2,0,g.Width/2,g.Height)
g.DrawLine(0,g.Height/2,g.Width,g.Height/2)
//some lines that should be…elsewhere
g.DrawingColor = &ccc1233
gp.MoveToPoint(0,0)
gp.AddLineToPoint(g.width,0)
gp.AddLineToPoint(g.width,g.Height)
gp.AddLineToPoint(g.width/2,-g.height/2)
g.DrawPath gp
//and a rectangle that should outline the fill rectangle above, but doesn’t (for me).
var g2 as new GraphicsPath
g2.AddRectangle(5,5,g.Width-10,g.Height-10)
g.DrawingColor=&cFFAAAA
g.DrawPath g2
[/code]
Yields the black lines from the DrawLine calls right in the middle as expected and the filled rectangle inset 5 pixels from all sides, but then the GraphicsPath objects are all halfway down the window.
I presume there is something stupid I have missed, either a document describing this…um, unique… coordinate system, or I have something somewhere that influences GraphicsPaths all on their own. Mac OS Mojave, Xojo 2019R3.1. Thanks for insights.