From d6ea60b2e5ff8dc0e15645b5911b7e81886b06fe Mon Sep 17 00:00:00 2001 From: tpoole Date: Mon, 17 Jul 2017 18:33:07 +0100 Subject: [PATCH] Flexbox: Fixed a bug in the integer rounding of component bounds --- modules/juce_gui_basics/layout/juce_FlexBox.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/juce_gui_basics/layout/juce_FlexBox.cpp b/modules/juce_gui_basics/layout/juce_FlexBox.cpp index 8513b9b7c6..bdaaea8060 100644 --- a/modules/juce_gui_basics/layout/juce_FlexBox.cpp +++ b/modules/juce_gui_basics/layout/juce_FlexBox.cpp @@ -787,7 +787,13 @@ void FlexBox::performLayout (Rectangle 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);