RFR: 8280020: Underline and line-through not straight in WebView [v3]
Kevin Rushforth
kcr at openjdk.java.net
Wed Feb 23 01:28:50 UTC 2022
On Mon, 21 Feb 2022 05:30:36 GMT, Jay Bhaskar <duke at openjdk.java.net> wrote:
>> 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.
>
> for (int i = line_start_y; i <= (width - line_start_y -6); i++) { , this meets the condition of sampling near the right edge
You are mixing values that should affect `x` (width) with values that should affect `y` (height and thickness). Using height or thickness to adjust the `x` value or using width to adjust the `y` value is wrong.
One thing that might help make it clearer is to use `y` as the name of the loop variable rather than `i`. Another thing that might help is to define a `thickness` constant rather than using 20. Then it will be more obvious where you are mixing x and y.
-------------
PR: https://git.openjdk.java.net/jfx/pull/731
More information about the openjfx-dev
mailing list