On Tue, 25 Feb 2020 07:11:43 GMT, Arun Joseph <[email protected]> wrote:
>> This bug can be reproduced when the screen resolution is at 125%, 150% and
>> 175% for Windows, which correpsonds to
>> `pixelScale` values of 1.25, 1.5 and 1.75, respectively.
>> Issue: The rectangle inside canvas is rendered on `pixelScale` while the
>> borders are rendered on `Math.ceil(pixelScale)`
>>
>> Fix: Use `Math.ceil(pixelScale)` for calculating `pixelScaleTransform`
>
> Arun Joseph has updated the pull request incrementally with one additional
> commit since the last revision:
>
> Added CanvasTest
The fix looks good to me. I left one comment on the test.
tests/system/src/test/java/test/javafx/scene/web/CanvasTest.java line 125:
> 124: assertEquals("Rect bottom-right corner", redColor,
> (int) webView.getEngine().executeScript(
> 125:
> "document.getElementById('canvas').getContext('2d').getImageData(99, 99, 1,
> 1).data[0]"));
> 126: webViewStateLatch.countDown();
An assertion failure here will not be propagated outside the listener. A
failure will be reported as a timeout rather
than an assertion failure.
I recommend moving the above two assertion checks to a `Util.runAndWait` block
at the end of this method -- after the
await call for `webViewStateLatch`.
-------------
PR: https://git.openjdk.java.net/jfx/pull/62