Skip to content

Commit

Permalink
Only repeat layout if certain properties change
Browse files Browse the repository at this point in the history
  • Loading branch information
ImJimmi committed Nov 12, 2023
1 parent 75925f3 commit e932678
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions jive_layouts/layout/gui-items/flex/jive_FlexContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,21 @@ namespace jive
}
}

void FlexContainer::valueTreePropertyChanged(juce::ValueTree&, const juce::Identifier&)
void FlexContainer::valueTreePropertyChanged(juce::ValueTree& tree, const juce::Identifier& id)
{
if (tree != state && tree.getParent() != state)
return;

if (layoutRecursionLock)
changesDuringLayout = true;
{
static const juce::Array<juce::Identifier> propertiesForWhichChangesRequireAnotherLayOut{
"ideal-width",
"ideal-height",
};

if (propertiesForWhichChangesRequireAnotherLayOut.contains(id))
changesDuringLayout = true;
}
}

juce::FlexBox FlexContainer::buildFlexBox(juce::Rectangle<float> bounds,
Expand Down

0 comments on commit e932678

Please sign in to comment.