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

Jay Bhaskar duke at openjdk.java.net
Mon Feb 21 05:34:00 UTC 2022


On Mon, 21 Feb 2022 04:19:29 GMT, Jay Bhaskar <duke at openjdk.java.net> wrote:

>> 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.

int i = line_start_y; i < (line_start_y - 6); i++ , this meets the condition of sampling near the right edge

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

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


More information about the openjfx-dev mailing list