Merge pull request #1189 from mildmongrel/fix_col_layout
Fixed horizontal positioning in multicolumn layout.
This commit is contained in:
commit
955cc3920f
1 changed files with 6 additions and 6 deletions
|
@ -202,14 +202,14 @@ void GameScene::processViewSizeChange(const QSize &newSize)
|
||||||
setSceneRect(0, 0, newWidth, sceneRect().height());
|
setSceneRect(0, 0, newWidth, sceneRect().height());
|
||||||
|
|
||||||
qreal extraWidthPerColumn = (newWidth - minWidth) / playersByColumn.size();
|
qreal extraWidthPerColumn = (newWidth - minWidth) / playersByColumn.size();
|
||||||
for (int col = 0; col < playersByColumn.size(); ++col)
|
qreal newx = phasesToolbar->getWidth();
|
||||||
|
for (int col = 0; col < playersByColumn.size(); ++col) {
|
||||||
for (int row = 0; row < playersByColumn[col].size(); ++row){
|
for (int row = 0; row < playersByColumn[col].size(); ++row){
|
||||||
playersByColumn[col][row]->processSceneSizeChange(minWidthByColumn[col] + extraWidthPerColumn);
|
playersByColumn[col][row]->processSceneSizeChange(minWidthByColumn[col] + extraWidthPerColumn);
|
||||||
if (col == 0)
|
playersByColumn[col][row]->setPos(newx, playersByColumn[col][row]->y());
|
||||||
playersByColumn[col][row]->setPos(phasesToolbar->getWidth(), playersByColumn[col][row]->y());
|
|
||||||
else
|
|
||||||
playersByColumn[col][row]->setPos(phasesToolbar->getWidth() + (newWidth - phasesToolbar->getWidth()) / 2, playersByColumn[col][row]->y());
|
|
||||||
}
|
}
|
||||||
|
newx += minWidthByColumn[col] + extraWidthPerColumn;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameScene::updateHover(const QPointF &scenePos)
|
void GameScene::updateHover(const QPointF &scenePos)
|
||||||
|
@ -295,4 +295,4 @@ void GameScene::resizeRubberBand(const QPointF &cursorPoint)
|
||||||
void GameScene::stopRubberBand()
|
void GameScene::stopRubberBand()
|
||||||
{
|
{
|
||||||
emit sigStopRubberBand();
|
emit sigStopRubberBand();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue