From 4af9526ab52fd0149463285e10d11004f5afe0b3 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 11 Jun 2018 10:38:14 +0100 Subject: [PATCH] Fixed a bug in Grid where the area calculation could terminate early --- modules/juce_gui_basics/layout/juce_Grid.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/juce_gui_basics/layout/juce_Grid.cpp b/modules/juce_gui_basics/layout/juce_Grid.cpp index 2c9361c63c..752e05e6a3 100644 --- a/modules/juce_gui_basics/layout/juce_Grid.cpp +++ b/modules/juce_gui_basics/layout/juce_Grid.cpp @@ -298,7 +298,12 @@ struct Grid::PlacementHelpers const std::map& namedAreas) { if (item.area.isNotEmpty() && ! grid.templateAreas.isEmpty()) + { + // Must be a named area! + jassert (namedAreas.count (item.area) != 0); + return namedAreas.at (item.area); + } return { deduceLineRange (item.column, grid.templateColumns), deduceLineRange (item.row, grid.templateRows) }; @@ -349,11 +354,7 @@ struct Grid::PlacementHelpers } else { - if (string == emptyAreaCharacter) - { - break; - } - else if (string == area.name) + if (string == area.name) { area.lines.row.end = stringsArrays.indexOf (stringArray) + 2; area.lines.column.end = stringArray.indexOf (string) + 2;