Stroked text not measured correctly on Canvas (breaks effects/etc)
I broke this case when I pushed this changeset:
RT-26270: Fix NGCanvas to use NGSpan/TextLayout
http://jfxsrc.us.oracle.com/javafx/8.0/scrum/graphics/rt/rev/53aa1e174202
Before that the text bounds were computed by the late NGTextHelper.
I moved the needed functionality inside of NGCanvas, which was fine since it had all the support there to handle other shapes.
What I missed is that the final bounds for stroked text is the union of the shape bounds and text logical bounds.
If you have an old repo around the relevant code is in NGTextHelper lines 1198:1201:
// Stroked text requires visual bounds, when include padding
BaseBounds vBounds = computeBoundsVisual(null, IDENT);
// Union between logical and visual bounds
retBounds.deriveWithUnion(vBounds);
Had the string in your test case had a 'q' or 'p' the bug would not have shown as much as it was the space of the font descent which was missing.
I broke this case when I pushed this changeset:
http://jfxsrc.us.oracle.com/javafx/8.0/scrum/graphics/rt/rev/53aa1e174202
Before that the text bounds were computed by the late NGTextHelper.
I moved the needed functionality inside of NGCanvas, which was fine since it had all the support there to handle other shapes.
What I missed is that the final bounds for stroked text is the union of the shape bounds and text logical bounds.
If you have an old repo around the relevant code is in NGTextHelper lines 1198:1201:
// Stroked text requires visual bounds, when include padding
BaseBounds vBounds = computeBoundsVisual(null, IDENT);
// Union between logical and visual bounds
retBounds.deriveWithUnion(vBounds);
Had the string in your test case had a 'q' or 'p' the bug would not have shown as much as it was the space of the font descent which was missing.