FlexBox bug (again)

Changed the demo to use a 1px align at the right, at some sizes the margin is 0px / 2px

latest tip, develop

Its due the the same issue with the other previous issue, the coordinates should be always rounded from absolute coordinates (set bottom-right, not width-height)

anyone from the juce team?

I thought we were rounding to absolute positions:

Hmm, that code could be neater

comp->setBounds ({ item.currentBounds.getPosition()   .roundToInt(),
                   item.currentBounds.getBottomRight().roundToInt() });

but it’s functioning the same.

My suspicion is that we’re falling foul of of some rounding error where we’re very close to a .5 boundary - where the centre of the 1px white line is at an integer position.

Just an idea, shoudn‘t the coordinats always rounded down?
Because components are integer based, the responsible pixel between 0.000 and 0.999 is 0 (which fills the whole pixel), and calculated coordinates beginning with 0.000.

If I use roundToIntAccurate rather than roundToInt then the problem is fixed, but that feels a bit brittle; always rounding down seems sensible.

https://github.com/WeAreROLI/JUCE/commit/75236aa61d7a7eaa239bcd80e82809ec55c9a58b

1 Like

Looks good!