diff --git a/src/apps/diskusage/ControlsView.cpp b/src/apps/diskusage/ControlsView.cpp index dcb1c00d81..b5d222af63 100644 --- a/src/apps/diskusage/ControlsView.cpp +++ b/src/apps/diskusage/ControlsView.cpp @@ -73,8 +73,8 @@ VolumeTab::IconWidth() const void VolumeTab::DrawLabel(BView* owner, BRect frame) { - owner->SetDrawingMode(B_OP_OVER); if (fIcon != NULL) { + owner->SetDrawingMode(B_OP_OVER); owner->MovePenTo(frame.left + kSmallHMargin, (frame.top + frame.bottom - fIcon->Bounds().Height()) / 2.0); owner->DrawBitmap(fIcon); @@ -188,13 +188,9 @@ ControlsView::VolumeTabView::TabFrame(int32 index) const oldToShave = toShave; for (int32 i = 0; i < countTabs; i++) { float iconWidth = ((VolumeTab*)TabAt(i))->IconWidth(); - float newMargin = margins[i] - averageToShave; - - toShave -= averageToShave; - if (newMargin < minimumMargin + iconWidth) { - toShave += minimumMargin - newMargin + iconWidth; - newMargin = minimumMargin + iconWidth; - } + float newMargin = max_c(margins[i] - averageToShave, + minimumMargin + iconWidth); + toShave -= margins[i] - newMargin; margins[i] = newMargin; } } while (toShave > 0 && oldToShave != toShave);