Browse Source

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.
v7.0.9
attila 3 years ago
parent
commit
44dd0649fd
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      modules/juce_gui_basics/layout/juce_Grid.cpp

+ 1
- 1
modules/juce_gui_basics/layout/juce_Grid.cpp View File

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


Loading…
Cancel
Save