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

Fixed a FlexBox rounding bug

This commit is contained in:
tpoole 2017-10-19 19:53:06 +01:00
parent 20147fc0cc
commit 75236aa61d

View file

@ -790,16 +790,13 @@ void FlexBox::performLayout (Rectangle<float> targetArea)
{
item.currentBounds += targetArea.getPosition();
if (auto comp = item.associatedComponent)
{
auto position = item.currentBounds.getPosition().roundToInt();
comp->setBounds (position.getX(),
position.getY(),
roundToInt (item.currentBounds.getRight()) - position.getX(),
roundToInt (item.currentBounds.getBottom()) - position.getY());
}
if (auto* comp = item.associatedComponent)
comp->setBounds (Rectangle<int>::leftTopRightBottom ((int) item.currentBounds.getX(),
(int) item.currentBounds.getY(),
(int) item.currentBounds.getRight(),
(int) item.currentBounds.getBottom()));
if (auto box = item.associatedFlexBox)
if (auto* box = item.associatedFlexBox)
box->performLayout (item.currentBounds);
}
}