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

yosbits duke at openjdk.java.net
Sat Feb 12 04:28:11 UTC 2022


On Thu, 10 Feb 2022 11:36:38 GMT, Jay Bhaskar <duke at 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)

thickness is probably specified in this CSS property

* https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration-thickness

The fixed code also has a lot of problems, so
We can understand how to fix it by comparing it with CoreGraphics. It will be up to the leader to decide when to make the remaining fixes. 

The source code history looks wrong when trying to correspond to thickness.

* https://github.com/openjdk/jfx/blame/8955c2d5fe345d294d8a5ddba09fc23752a07c84/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/java/GraphicsContextJava.cpp

Another probably performance issue,

``` Java
      StrokeStyle savedStrokeStyle = strokeStyle ();
     setStrokeStyle (stroke);



``` Java
     setStrokeStyle (savedStrokeStyle);
}


This looks better outside the loop.

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

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


More information about the openjfx-dev mailing list