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
097090ac
Commit
097090ac
authored
Nov 03, 2014
by
Matt Lowe
Browse files
Updated static variable name
+ Updated DELTA variable to more suitable name: ROTATION_DEGREES_PER_FRAME
parent
c130ee92
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/carditem.cpp
View file @
097090ac
...
@@ -364,11 +364,11 @@ void CardItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
...
@@ -364,11 +364,11 @@ void CardItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
bool
CardItem
::
animationEvent
()
bool
CardItem
::
animationEvent
()
{
{
int
delta
=
DELTA
;
int
rotation
=
ROTATION_DEGREES_PER_FRAME
;
if
(
!
tapped
)
if
(
!
tapped
)
delta
*=
-
1
;
rotation
*=
-
1
;
tapAngle
+=
delta
;
tapAngle
+=
rotation
;
setTransform
(
QTransform
().
translate
(
CARD_WIDTH_HALF
,
CARD_HEIGHT_HALF
).
rotate
(
tapAngle
).
translate
(
-
CARD_WIDTH_HALF
,
-
CARD_HEIGHT_HALF
));
setTransform
(
QTransform
().
translate
(
CARD_WIDTH_HALF
,
CARD_HEIGHT_HALF
).
rotate
(
tapAngle
).
translate
(
-
CARD_WIDTH_HALF
,
-
CARD_HEIGHT_HALF
));
setHovered
(
false
);
setHovered
(
false
);
...
...
cockatrice/src/carditem.h
View file @
097090ac
...
@@ -14,8 +14,7 @@ class QColor;
...
@@ -14,8 +14,7 @@ class QColor;
const
int
MAX_COUNTERS_ON_CARD
=
999
;
const
int
MAX_COUNTERS_ON_CARD
=
999
;
const
float
CARD_WIDTH_HALF
=
CARD_WIDTH
/
2
;
const
float
CARD_WIDTH_HALF
=
CARD_WIDTH
/
2
;
const
float
CARD_HEIGHT_HALF
=
CARD_HEIGHT
/
2
;
const
float
CARD_HEIGHT_HALF
=
CARD_HEIGHT
/
2
;
// DELTA is the degrees of rotation that will animate between frames
const
int
ROTATION_DEGREES_PER_FRAME
=
10
;
const
int
DELTA
=
10
;
class
CardItem
:
public
AbstractCardItem
{
class
CardItem
:
public
AbstractCardItem
{
Q_OBJECT
Q_OBJECT
...
...
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