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
79a3a1a0
Commit
79a3a1a0
authored
Sep 22, 2010
by
Max-Wilhelm Bruker
Browse files
economic layout bug fix
parent
42363840
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/tablezone.cpp
View file @
79a3a1a0
...
@@ -209,23 +209,21 @@ CardItem *TableZone::getCardFromCoords(const QPointF &point) const
...
@@ -209,23 +209,21 @@ CardItem *TableZone::getCardFromCoords(const QPointF &point) const
QPointF
TableZone
::
mapFromGrid
(
const
QPoint
&
gridPoint
)
const
QPointF
TableZone
::
mapFromGrid
(
const
QPoint
&
gridPoint
)
const
{
{
if
((
gridPoint
.
y
()
==
3
)
&&
(
settingsCache
->
getEconomicGrid
()))
qreal
x
,
y
;
return
QPointF
(
if
((
gridPoint
.
y
()
==
3
)
&&
(
settingsCache
->
getEconomicGrid
()))
{
marginX
+
(
CARD_WIDTH
*
gridPoint
.
x
()
+
CARD_WIDTH
*
(
gridPoint
.
x
()
/
3
))
/
2
,
x
=
marginX
+
(
CARD_WIDTH
*
gridPoint
.
x
()
+
CARD_WIDTH
*
(
gridPoint
.
x
()
/
3
))
/
2
;
boxLineWidth
+
(
CARD_HEIGHT
+
paddingY
)
*
gridPoint
.
y
()
+
(
gridPoint
.
x
()
%
3
*
CARD_HEIGHT
)
/
3
y
=
boxLineWidth
+
(
CARD_HEIGHT
+
paddingY
)
*
gridPoint
.
y
()
+
(
gridPoint
.
x
()
%
3
*
CARD_HEIGHT
)
/
3
;
);
}
else
{
else
{
x
=
marginX
+
0.5
*
CARD_WIDTH
*
gridPoint
.
x
();
qreal
x
=
marginX
+
0.5
*
CARD_WIDTH
*
gridPoint
.
x
();
for
(
int
i
=
0
;
i
<
gridPoint
.
x
();
++
i
)
for
(
int
i
=
0
;
i
<
gridPoint
.
x
();
++
i
)
x
+=
gridPointWidth
.
value
(
gridPoint
.
y
()
*
1000
+
i
,
CARD_WIDTH
);
x
+=
gridPointWidth
.
value
(
gridPoint
.
y
()
*
1000
+
i
,
CARD_WIDTH
);
qreal
y
=
boxLineWidth
+
(
CARD_HEIGHT
+
paddingY
)
*
gridPoint
.
y
();
y
=
boxLineWidth
+
(
CARD_HEIGHT
+
paddingY
)
*
gridPoint
.
y
();
if
(
player
->
getMirrored
())
y
=
height
-
CARD_HEIGHT
-
y
;
return
QPointF
(
x
,
y
);
}
}
if
(
player
->
getMirrored
())
y
=
height
-
CARD_HEIGHT
-
y
;
return
QPointF
(
x
,
y
);
}
}
QPoint
TableZone
::
mapToGrid
(
const
QPointF
&
mapPoint
)
const
QPoint
TableZone
::
mapToGrid
(
const
QPointF
&
mapPoint
)
const
...
...
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