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
80fd0fbc
Commit
80fd0fbc
authored
Oct 17, 2014
by
Matt Lowe
Browse files
Removed inline logic
Removed inline logic to static variable, slight performance increase.
parent
2a15b9c9
Changes
1
Show whitespace changes
Inline
Side-by-side
cockatrice/src/abstractcarddragitem.cpp
View file @
80fd0fbc
...
@@ -4,6 +4,9 @@
...
@@ -4,6 +4,9 @@
#include
<QGraphicsSceneMouseEvent>
#include
<QGraphicsSceneMouseEvent>
#include
<QDebug>
#include
<QDebug>
static
const
float
CARD_WIDTH_HALF
=
CARD_WIDTH
/
2
;
static
const
float
CARD_HEIGHT_HALF
=
CARD_HEIGHT
/
2
;
AbstractCardDragItem
::
AbstractCardDragItem
(
AbstractCardItem
*
_item
,
const
QPointF
&
_hotSpot
,
AbstractCardDragItem
*
parentDrag
)
AbstractCardDragItem
::
AbstractCardDragItem
(
AbstractCardItem
*
_item
,
const
QPointF
&
_hotSpot
,
AbstractCardDragItem
*
parentDrag
)
:
QGraphicsItem
(),
item
(
_item
),
hotSpot
(
_hotSpot
)
:
QGraphicsItem
(),
item
(
_item
),
hotSpot
(
_hotSpot
)
{
{
...
@@ -22,7 +25,7 @@ AbstractCardDragItem::AbstractCardDragItem(AbstractCardItem *_item, const QPoint
...
@@ -22,7 +25,7 @@ AbstractCardDragItem::AbstractCardDragItem(AbstractCardItem *_item, const QPoint
setZValue
(
2000000007
);
setZValue
(
2000000007
);
}
}
if
(
item
->
getTapped
())
if
(
item
->
getTapped
())
setTransform
(
QTransform
().
translate
(
(
float
)
CARD_WIDTH
/
2
,
(
float
)
CARD_HEIGHT
/
2
).
rotate
(
90
).
translate
(
(
float
)
-
CARD_WIDTH
/
2
,
(
float
)
-
CARD_HEIGHT
/
2
));
setTransform
(
QTransform
().
translate
(
CARD_WIDTH
_HALF
,
CARD_HEIGHT
_HALF
).
rotate
(
90
).
translate
(
-
CARD_WIDTH
_HALF
,
-
CARD_HEIGHT
_HALF
));
setCacheMode
(
DeviceCoordinateCache
);
setCacheMode
(
DeviceCoordinateCache
);
}
}
...
...
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