[4616] in java-interest
Re: drawRect() -- Why, oh why?
daemon@ATHENA.MIT.EDU (Arthur van Hoff)
Tue Jan 9 15:01:36 1996
Date: Tue, 9 Jan 1996 10:11:47 -0800
From: Arthur.Vanhoff@Eng.Sun.COM (Arthur van Hoff)
To: chris@tkna.com
Cc: java-interest@java.Eng.Sun.COM
Hi Christopher,
> Why does drawRect(x, y, width, height) draw a rectangle width+1 pixels wide
> and height+1 high, while fillRect(x, y, width, height) draws a solid rectangle
> width pixels wide and hieght pixels tall? The documentation indicates that
> this is a feature of drawRect() and not a bug. Why?
Most line drawing algorithms work that way. The reason is that it behaves the
same as open figures such as splines and polygons. The insideness of the line
is hard to guarantee in that case. It is simply an artifact of the limited
resolution of your screen. The real solution would be to always draw a line
that is several pixels wide which runs exactly over the middle (that is what
PostScript does on highres devices).
Have fun,
Arthur van Hoff
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com