JUCE
JUCE copied to clipboard
[Bug]: Grid gap size rounding issue on Windows
Detailed steps on how to reproduce the bug
juce::Grid
's item bounds calculation with rounding leads to inconsistent behavior on Windows regarding rendering of the gap property. It seems to be independent of the DPI and monitor scaling. This is especially visible if the gap is set to 1px and the grid is resized.
To reproduce:
- open up juce's GridDemo
- set the
grid.rowGap
andgrid.columnGap
to1_px
- for better visibility, set the grid item panel colours to
Colours::white
- launch the demo and observe the behavior while resizing:
Similarly, setting the gap to 2_px
leads to rounding between 1px and 2px and still flickers while resizing.
What is the expected behaviour?
The expected behavior is that the gap is exactly as wide as set in the variable(s). In the example it should be 1px wide - but it sometimes vanishes due to rounding.
Note: It also seems that the pixel and bounds calculation greatly differs with respect to subpixel handling between juce::Grid
and juce::FlexBox
! FlexBox does not have this issue.
Operating systems
Windows
What versions of the operating systems?
Tested on Windows 10 x64
Architectures
64-bit
Stacktrace
No response
Plug-in formats (if applicable)
No response
Plug-in host applications (DAWs) (if applicable)
No response
Testing on the develop
branch
The bug is present on the develop
branch
Code of Conduct
- [X] I agree to follow the Code of Conduct