DiskUsage: fix infinite loop when computing tab width
Stop when we have a solution that is within 1px of accurate. Since tab width are rounded to the nearest pixel anyway, there is no need to compute further, and this could otherwise never converge due to rounding errors. Fixes #15944.
This commit is contained in:
@@ -203,7 +203,7 @@ ControlsView::VolumeTabView::TabFrame(int32 index) const
|
||||
toShave -= margins[i] - newMargin;
|
||||
margins[i] = newMargin;
|
||||
}
|
||||
} while (toShave > 0 && oldToShave != toShave);
|
||||
} while (toShave > 0 && fabs(oldToShave - toShave) >= 1.0f);
|
||||
}
|
||||
|
||||
for (int i = 0; i < index; i++)
|
||||
|
||||
Reference in New Issue
Block a user