JDK-6478620 : CheckBox's right marks touches the border by 1 pixel in mustang.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2006-10-05
  • Updated: 2011-04-29
Related Reports
Relates :  
Description
Step to reproduce:
---------------------
1) Run the attached program. You can run both in  Tiger as well as mustang. 
2) Keep both the gui , tiger & mustang run both next to each other so that you can see the difference. Observe in mustang run gui , the right mark of checkbox is one pixel on the border. 
I have attached the screen shots of the same.

Comments
EVALUATION In fix of the 6344227 we've added some control over the rendering process by handling STROKE_CONTROL rendering hint. So, since than users can change the behavior of the rendering engine by setting up appropriate rendering hints. In fix of the 6344227 we've introduced two modes of rendering that corresponds to two types of mapping between user and device coordinate spaces. They are "pixels in centers" and "pixels in corners". That means location of the device coordinates in fractional coordinate cell. These modes of drawing can be set up as follows: 1. "pixels in corners" - default rendering behavior that corresponds to the most well known algorithms like integer Bresenham for lines and ovals. g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_DEFAULT); 2. "pixels in corners" g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE); Before the fix of the 6344227 there was large inconsistency between draw and fill code, so behavior of the fill code was changed to align with draw one. That unfortunately, caused some changes in the rendering like we see in this report. For cases like with, there is still an option to revert old behavior just setting VALUE_STROKE_PURE to the KEY_STROKE_CONTROL rendering hint. Taking all of the above into account, I'm reassigning this CR to AWT. The problems in AWT code could be easily resolved just by setting appropriate rendering hints.
09-10-2006

EVALUATION I have attached a simple test (PaintCheckbox.java) which can be used to reproduced the problem. There is no checkbox in the test, instead I have just copied all the drawing from XCheckboxPeer into a lightweight component's paint(Graphics g) method and the problem remains the same: it is reproducible with b77 and not reproducible with b71. Thus, something wrong with Java2D rendering, not with AWT checkbox.
09-10-2006

EVALUATION This bug is introduced somewhere between b71 and b77 builds of JDK 6.0. I suspect it appeared because of some Java 2D rendering change.
09-10-2006