Bug 27844 - Graphics2D.drawLine(x,y,x,y) should draw a single pixel
Summary: Graphics2D.drawLine(x,y,x,y) should draw a single pixel
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: awt (show other bugs)
Version: 0.92
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-31 18:15 UTC by Norman Hendrich
Modified: 2006-12-01 15:55 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
testcase to trigger the bug. (1.12 KB, text/plain)
2006-05-31 18:18 UTC, Norman Hendrich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Norman Hendrich 2006-05-31 18:15:53 UTC
The reference implementation provides no special method to draw a single pixel.
Instead, Graphics.drawLine(x,y,x,y) can be used to draw a single pixel in the
current foreground color. This also works for Graphics2D (at least when using
integer coordinates and a corresponding AffineTransform).

The current implementation of classpath does not handle this special case; checked with classpath cvs 2006.05.31. See the attached testcase for a simple demonstration.
 
Best, Norman
Comment 1 Norman Hendrich 2006-05-31 18:18:17 UTC
Created attachment 11555 [details]
testcase to trigger the bug.

The testcase display a frame with two instances of class PointGridCanvas.#
The left instance draws a grid consisting of 1-pixel wide lines, the right
instance uses the special case of 0-pixel wide lines. The latter one results
in 1 pixel points on the reference implementation, and invisible lines on
classpath cvs 2006.05.31.
Comment 2 Francis Kung 2006-12-01 15:55:35 UTC
Seems to have been fixed some time in the past months