Do not risk a division by zero.

This commit is contained in:
Teo Mrnjavac 2015-07-23 17:47:17 +02:00
parent 409bde6d1f
commit cd0f5d8778
1 changed files with 3 additions and 0 deletions

View File

@ -110,6 +110,9 @@ void PartWidgetBase::positionChildren(const QWidget* destWidget, const Partition
foreach(const Partition * p, partitions)
totalLength += p->length();
if (totalLength < 1)
return;
// calculate unleveled width for each child and store it
for (int i = 0; i < partitions.size(); i++) {
childrenWidth.append(partitions[i]->length() * destWidgetWidth / totalLength);