GDI Plus and DrawRect

Without GDI Plus you can draw a rect with g.DrawRect 200, 200, -100, -100 (negative values for width or height)

It fails with GDI Plus on.

Is this by design or should I file a feedback?

[quote=199416:@Peter Fargo]Without GDI Plus you can draw a rect with g.DrawRect 200, 200, -100, -100 (negative values for width or height)

It fails with GDI Plus on.

Is this by design or should I file a feedback?[/quote]

Indeed the rectangle disappears with GDI+. No crash, though.

I may be old fashion, but I would tend to think in terms of width and height as positive only. I personally would tend to go g.DrawRect(100, 100, 100, 100) instead. Using them the way you do seems kind of counter intuitive. But hey, these are virtual things. Since the LR does not say anything about negative or positive value…

That said, the only risk you run filing a feedback is that they tell you its by design.

The reason I use negative values (in this case) is for a selection rectangle. Not a big deal but avoids calculating new values.

[code]Sub UpdateSelectionRectangle(OffsetX As Integer, OffsetY As Integer)
If OffsetX <> 0 then

SelectionRectItem.Width = SelectionRectItem.Width + OffsetX

end if

If OffsetY <> 0 then

SelectionRectItem.Height = SelectionRectItem.Height + OffsetY

end if

exit

End Sub
[/code]