Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
955cc392
Commit
955cc392
authored
Jul 07, 2015
by
Zach
Browse files
Merge pull request #1189 from mildmongrel/fix_col_layout
Fixed horizontal positioning in multicolumn layout.
parents
f0efab51
75d0d5f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/gamescene.cpp
View file @
955cc392
...
...
@@ -202,14 +202,14 @@ void GameScene::processViewSizeChange(const QSize &newSize)
setSceneRect
(
0
,
0
,
newWidth
,
sceneRect
().
height
());
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
){
playersByColumn
[
col
][
row
]
->
processSceneSizeChange
(
minWidthByColumn
[
col
]
+
extraWidthPerColumn
);
if
(
col
==
0
)
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
());
playersByColumn
[
col
][
row
]
->
setPos
(
newx
,
playersByColumn
[
col
][
row
]
->
y
());
}
newx
+=
minWidthByColumn
[
col
]
+
extraWidthPerColumn
;
}
}
void
GameScene
::
updateHover
(
const
QPointF
&
scenePos
)
...
...
@@ -295,4 +295,4 @@ void GameScene::resizeRubberBand(const QPointF &cursorPoint)
void
GameScene
::
stopRubberBand
()
{
emit
sigStopRubberBand
();
}
\ No newline at end of file
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment