If I apply a linear gradient on a rectangle which is just moved with translateX, it works.
But if the rectangle is placed in a more or less complex layout, the gradient is incorrect, it acts as if the endX is much bigger than it is actually.
I made a simple script to illustrate the program: if you run as provided, with GetSimpleDisplay() call, it works. If you replace this function with GetSemiComplexDisplay(), you get a first discrepancy. If you replace it with GetComplexDisplay(), it is even more visible: it looks like the horizontal offset induced by the layout acts on the gradient computation.
I made two linear gradients to see if the issue was because of gradient switch,
but the issue shows without that...
RT-5762 LinearGradient not working inside a VBox or HBox
shows a different (?), but related issue.
But if the rectangle is placed in a more or less complex layout, the gradient is incorrect, it acts as if the endX is much bigger than it is actually.
I made a simple script to illustrate the program: if you run as provided, with GetSimpleDisplay() call, it works. If you replace this function with GetSemiComplexDisplay(), you get a first discrepancy. If you replace it with GetComplexDisplay(), it is even more visible: it looks like the horizontal offset induced by the layout acts on the gradient computation.
I made two linear gradients to see if the issue was because of gradient switch,
but the issue shows without that...
shows a different (?), but related issue.
- duplicates
-
JDK-8107513 Gradients don't translate correctly w/ JDK6u12
- Closed