Browse Source

Flexbox: Fixed a bug in the integer rounding of component bounds

tags/2021-05-28
tpoole 8 years ago
parent
commit
d6ea60b2e5
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      modules/juce_gui_basics/layout/juce_FlexBox.cpp

+ 7
- 1
modules/juce_gui_basics/layout/juce_FlexBox.cpp View File

@@ -787,7 +787,13 @@ void FlexBox::performLayout (Rectangle<float> targetArea)
item.currentBounds += targetArea.getPosition();
if (auto comp = item.associatedComponent)
comp->setBounds (item.currentBounds.getSmallestIntegerContainer());
{
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 box = item.associatedFlexBox)
box->performLayout (item.currentBounds);


Loading…
Cancel
Save