- // as at least one visible item has non-zero proportion the total
- // proportion must be non zero
- majorSize += (delta * item->GetProportion()) / m_totalProportion;
+ const int deltaItem = (delta * propItem) / totalProportion;
+
+ majorSize += deltaItem;
+
+ delta -= deltaItem;
+ totalProportion -= propItem;