Improve efficiency when validating an ALM layout.
This commit is contained in:
@@ -1016,12 +1016,6 @@ BALMLayout::UpdateConstraints(BLayoutContext* context)
|
||||
for (int i = 0; i < CountItems(); i++)
|
||||
AreaFor(ItemAt(i))->InvalidateSizeConstraints();
|
||||
fRowColumnManager->UpdateConstraints();
|
||||
|
||||
if (context) {
|
||||
BSize size(LayoutArea().Size());
|
||||
Right()->SetRange(size.width, size.width);
|
||||
Bottom()->SetRange(size.height, size.height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -194,11 +194,17 @@ SharedSolver::ValidateLayout(BLayoutContext* context)
|
||||
if (fLayoutValid && fLayoutContext == context)
|
||||
return;
|
||||
|
||||
fConstraintsValid = false;
|
||||
_SetContext(context);
|
||||
_ValidateConstraints();
|
||||
fLayoutResult = fLinearSpec.Solve();
|
||||
|
||||
for (int32 i = fLayouts.CountItems() - 1; i >= 0; i--) {
|
||||
BALMLayout* layout = fLayouts.ItemAt(i);
|
||||
BSize size(layout->LayoutArea().Size());
|
||||
layout->Right()->SetRange(size.width, size.width);
|
||||
layout->Bottom()->SetRange(size.height, size.height);
|
||||
}
|
||||
|
||||
fLayoutResult = fLinearSpec.Solve();
|
||||
fLayoutValid = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user