1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Grid: Fix layout for very small items

Until this commit Items with a size of 1 could be rounded to
bounds with a size of 0 or 2 due to floating point errors, leading
to slightly too large or disappearing items. The new approach
preserves the size of items.
This commit is contained in:
attila 2022-09-16 11:23:17 +02:00
parent d05333b61d
commit 44dd0649fd

View file

@ -1047,7 +1047,7 @@ void Grid::performLayout (Rectangle<int> targetArea)
+ targetArea.toFloat().getPosition();
if (auto* c = item->associatedComponent)
c->setBounds (item->currentBounds.toNearestIntEdges());
c->setBounds (item->currentBounds.getSmallestIntegerContainer());
}
}