DrawRect different than in Windows

I have noticed that drawing a rect in Mac is different than in Windows. For sample, the code:

g.PenHeight = 6 g.PenWidth = 6 g.DrawRect(10,10,10,10)

Draws a rectangle 6 pixels wide starting in Windows at 7,7 and in Mac at 10,10. That means in Windows the pen width is distributed at both sides of the rect but in Mac only at inner side.

Is this a bug ?

Depends on perspective.

Thanks, can you explain a bit more what you mean?

It’s not defined, but I often had to fix it in my apps, because I prefer the Mac way.
So for Windows I had to adjust.
You can of course report this via Feedback, but a fix may break code.

[quote=131895:@Alejandro Fresno Meyer]I have noticed that drawing a rect in Mac is different than in Windows. For sample, the code:

g.PenHeight = 6 g.PenWidth = 6 g.DrawRect(10,10,10,10)

Draws a rectangle 6 pixels wide starting in Windows at 7,7 and in Mac at 10,10. That means in Windows the pen width is distributed at both sides of the rect but in Mac only at inner side. [/quote]

I would call that a major inconsistency. There is no intrinsic reason why it should not be possible to obtain exactly the same result from the very same Xojo code because of different platforms.

The only way to get the same result is now to draw several rectangles with a pen width of 1.

To me, this is a pure and blatant unacceptable bug. You should file a feedback report.

Come on, Christian… Either Xojo is able to produce the same result from the same code, or it is a bug. Even if a workaround can be found, this should be fixed.

Now, which ever way is chosen, it will indeed break code :frowning:

[quote=131931:@Michel Bujardet]
The only way to get the same result is now to draw several rectangles with a pen width of 1.[/quote]

Regarding I prefer the Windows way I solved it by compensating the penwidth at drawrect parameters, this way I get a centered line on both OS