On Sun, 13 Feb 2022 07:35:32 GMT, Jay Bhaskar <d...@openjdk.java.net> wrote:

>> Issue: The end point of  line in drawLinesForText , add thickness to the 
>> endPoint.y(). In this case origin which is start point and the end point 
>> would not be same, and line would be drawn not straight.
>> Solution: Do not add thickness to the y position of end point of line.
>> Start Point(x,y) ----------End Point(x + width, 0)
>
> Jay Bhaskar has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   adjust thickness

Good. So the only problem with the dashed case was the fact that we were 
looping and drawing the same dashed line _N_ times.

Do you know whether my guess about why we need to add `thickness/2` to `y` 
(caller is passing in the upper-left corner) is right?

In addition to a little more testing, I think we should do the following:

1. Edit the title of the JBS bug and this PR to indicate the somewhat broadened 
scope of the bug. Something like "WebView text underline and line-through 
rendered incorrectly"
2. Create a new system test that will render a thick solid line and a thick 
dashed line, use snapshot to capture the rendered output, and check that the 
line is drawn in the right place. If the thickness is large enough (at least 6 
pixels) you can sample 4 pixels vertically near the center of where the line 
should be and it should be black. For the dashed line, you can do the same in 
the middle (horizontally) of both an "on" segment, which should be black, and 
an "off" segment, which should be white.

-------------

PR: https://git.openjdk.java.net/jfx/pull/731

Reply via email to