RFR: 8280020: Underline and line-through not straight in WebView [v3]

Jay Bhaskar duke at openjdk.java.net
Mon Feb 21 04:22:59 UTC 2022


On Sat, 19 Feb 2022 14:55:30 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> Jay Bhaskar has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update test case for line straightness check
>
> tests/system/src/test/java/test/javafx/scene/web/StraightLineTest.java line 163:
> 
>> 161: 
>> 162:             // buttom start x position of underline ( startx + font size + thickness -1)
>> 163:             int line_start_x = start_x + height + 20 - 1;
> 
> The x value shouldn't be affected by thickness or the height. This should be something like `start_x + 3` (the `+3` is so you don't sample anywhere near the edge, to avoid boundary problems).
> 
> I also recommend sampling near the right edge to catch the problem of a slanted line, so: `int line_end_x = start_x + width - 3;`

The bounding rect.x rect.y is top left corner, and line is being drawn below the bottom, so height and thickness need to be considered.

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

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


More information about the openjfx-dev mailing list