How to draw a thin line?

A line along an integer coordinate will be anti-aliased and thus two pixels wide. You could probably call g.drawLine(0.5f, 0.5f, w+0.5f, 0.5f) (not sure whether it has to be +0.5 or -0.5). Also there is Graphics::drawHorizontalLine/Graphics::drawVerticalLine.
The top and left lines aren’t two pixels because they are clipped by the grapics context.

There is also a Graphics::drawRectangle available.

Chris

1 Like