juce-framework / JUCE

JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins.

Home Page:https://juce.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Grid gap size rounding issue on Windows

bernidb opened this issue · comments

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 and grid.columnGap to 1_px
  • for better visibility, set the grid item panel colours to Colours::white
  • launch the demo and observe the behavior while resizing:

JUCE_Grid_Gap_Bug

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

  • I agree to follow the Code of Conduct