I’m facing an issue with how rectangles are filled on Android devices.
Basically I’m drawing a grid of filled rectangles, separated by 1 pixel gaps.
What happens is that, depending on the bounds sizes, the 1 pixel gaps quite often disappear.
Here a video of the issue, showing the difference between the MacOS and the Android version.
Here you can find a minimal example that reproduces the issue:
The key drawing code is in the
paint() method, here.
To see the effect that subtle Component bounds changes have, they are updated from the
The desktop version (Mac OS in the case of the repo) does not present this issue.
Here some screenshots:
Here a screenshot from Samsung S7:
an interesting detail: the gaps never disappear on the S7, but their sizes change irregularly, apparently fluctuating between 1 and 2 pixels (never zero).
Since the drawing mathematics is purely integer-based, I suspect that there is some issue related to how Android reports screen size and / or how Juce handles the pixel coordinates transformations from “logical” pixel resolution to the actually lit “physical” pixel.