DiskUsage: Truncating of tabs could lead to deadlock (#9170)
This commit is contained in:
@@ -73,8 +73,8 @@ VolumeTab::IconWidth() const
|
|||||||
void
|
void
|
||||||
VolumeTab::DrawLabel(BView* owner, BRect frame)
|
VolumeTab::DrawLabel(BView* owner, BRect frame)
|
||||||
{
|
{
|
||||||
owner->SetDrawingMode(B_OP_OVER);
|
|
||||||
if (fIcon != NULL) {
|
if (fIcon != NULL) {
|
||||||
|
owner->SetDrawingMode(B_OP_OVER);
|
||||||
owner->MovePenTo(frame.left + kSmallHMargin,
|
owner->MovePenTo(frame.left + kSmallHMargin,
|
||||||
(frame.top + frame.bottom - fIcon->Bounds().Height()) / 2.0);
|
(frame.top + frame.bottom - fIcon->Bounds().Height()) / 2.0);
|
||||||
owner->DrawBitmap(fIcon);
|
owner->DrawBitmap(fIcon);
|
||||||
@@ -188,13 +188,9 @@ ControlsView::VolumeTabView::TabFrame(int32 index) const
|
|||||||
oldToShave = toShave;
|
oldToShave = toShave;
|
||||||
for (int32 i = 0; i < countTabs; i++) {
|
for (int32 i = 0; i < countTabs; i++) {
|
||||||
float iconWidth = ((VolumeTab*)TabAt(i))->IconWidth();
|
float iconWidth = ((VolumeTab*)TabAt(i))->IconWidth();
|
||||||
float newMargin = margins[i] - averageToShave;
|
float newMargin = max_c(margins[i] - averageToShave,
|
||||||
|
minimumMargin + iconWidth);
|
||||||
toShave -= averageToShave;
|
toShave -= margins[i] - newMargin;
|
||||||
if (newMargin < minimumMargin + iconWidth) {
|
|
||||||
toShave += minimumMargin - newMargin + iconWidth;
|
|
||||||
newMargin = minimumMargin + iconWidth;
|
|
||||||
}
|
|
||||||
margins[i] = newMargin;
|
margins[i] = newMargin;
|
||||||
}
|
}
|
||||||
} while (toShave > 0 && oldToShave != toShave);
|
} while (toShave > 0 && oldToShave != toShave);
|
||||||
|
|||||||
Reference in New Issue
Block a user