Skip to content

Commit

Permalink
Some minor cleaning up.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Dec 14, 2017
1 parent 5bd1ae0 commit 34265ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugins/widget/GraphPanelWidget/src/graphpanelswidget.cpp
Expand Up @@ -152,14 +152,14 @@ GraphPanelWidget * GraphPanelsWidget::addGraphPanel(const bool &pActive)
} else {
QIntList oldSizes = sizes();
QIntList newSizes = QIntList();
int oldTotalSize = height()-(mGraphPanels.count()-2)*handleWidth();
int newTotalSize = oldTotalSize-handleWidth();
double scalingFactor = double(mGraphPanels.count()-1)/mGraphPanels.count()*newTotalSize/oldTotalSize;
int oldTotalHeight = height()-(mGraphPanels.count()-2)*handleWidth();
int newTotalHeight = oldTotalHeight-handleWidth();
double scalingFactor = double(mGraphPanels.count()-1)/mGraphPanels.count()*newTotalHeight/oldTotalHeight;

for (int i = 0, iMax = oldSizes.count()-1; i < iMax; ++i)
newSizes << round(scalingFactor*oldSizes[i]);

setSizes(newSizes << newTotalSize-std::accumulate(newSizes.begin(), newSizes.end(), 0));
setSizes(newSizes << newTotalHeight-std::accumulate(newSizes.begin(), newSizes.end(), 0));
}

// Keep track of whenever a graph panel gets activated
Expand Down

0 comments on commit 34265ac

Please sign in to comment.