[OpenJDK 2D-Dev] [PATCH] Fix BasicStroke's usage of dash elements

Jennifer Godinez Jennifer.Godinez at Sun.COM
Tue Jan 13 20:24:02 UTC 2009


Hi Omair,

Oops just noticed that you are from RedHat so you are confirmed that you already signed the SCA.

Jennifer

Jennifer Godinez wrote:
> Hi Omair,
> 
> Thanks for submitting the patch.  Please confirm that you have already 
> signed the Sun Contributor Agreement (SCA).  See "Become a contributor" 
> in http://openjdk.java.net/contribute/.
> 
> Until that time, we will put this patch on hold.
> 
> Sincerely,
> Jennifer
> 
> 
> Omair Majid wrote:
>> Hi,
>>
>> The Java Tutorials [1] say this about the dash_array parameter of 
>> BasicStroke():
>>
>> The dash array defines the dash pattern. Alternating elements in the 
>> array represent the dash length and the length of the space between 
>> dashes in user coordinate units. Element 0 represents the first dash, 
>> element 1 the first space, and so on.
>>
>> However, in openjdk6 (and openjdk7 - I havent tested explicitly, just 
>> looked at the code) it seems to be the other way around: element 0 
>> represent the first space and element 1 the first dash (and so on). 
>> The attached program, when run with openjdk6, produces a solid black 
>> border around the button text instead of no border.
>>
>> The attached patch tries to fix the problem by initializing the 
>> renderer with dashOn = true so that the first element of the array 
>> produces a dash. The second element then produces a space and so on.
>>
>> Cheers,
>> Omair
>>
>> [1] 
>> http://java.sun.com/docs/books/tutorial/2d/geometry/strokeandfill.html
>>



More information about the 2d-dev mailing list