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:
Adrien Destugues
2020-05-10 11:07:47 +02:00
parent aca685fca1
commit 12e4ac5d81
+1 -1
View File
@@ -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++)