From 75236aa61d7a7eaa239bcd80e82809ec55c9a58b Mon Sep 17 00:00:00 2001 From: tpoole Date: Thu, 19 Oct 2017 19:53:06 +0100 Subject: [PATCH] Fixed a FlexBox rounding bug --- modules/juce_gui_basics/layout/juce_FlexBox.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/modules/juce_gui_basics/layout/juce_FlexBox.cpp b/modules/juce_gui_basics/layout/juce_FlexBox.cpp index cf7d2f3416..c082fcf86e 100644 --- a/modules/juce_gui_basics/layout/juce_FlexBox.cpp +++ b/modules/juce_gui_basics/layout/juce_FlexBox.cpp @@ -790,16 +790,13 @@ void FlexBox::performLayout (Rectangle 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::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); } }