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
9d6ecbbf
Commit
9d6ecbbf
authored
Mar 25, 2009
by
Max-Wilhelm Bruker
Browse files
fixed blurry tapped cards
parent
6e942211
Changes
3
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/carditem.cpp
View file @
9d6ecbbf
...
...
@@ -37,7 +37,11 @@ void CardItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
painter
->
save
();
QRectF
foo
=
option
->
matrix
.
mapRect
(
boundingRect
());
qDebug
(
QString
(
"%1: w=%2,h=%3"
).
arg
(
name
).
arg
(
foo
.
width
()).
arg
(
foo
.
height
()).
toLatin1
());
QPixmap
bar
=
image
->
scaled
((
int
)
foo
.
width
(),
(
int
)
foo
.
height
(),
Qt
::
IgnoreAspectRatio
,
Qt
::
SmoothTransformation
);
QPixmap
bar
;
if
(
tapped
)
bar
=
image
->
scaled
((
int
)
foo
.
height
(),
(
int
)
foo
.
width
(),
Qt
::
IgnoreAspectRatio
,
Qt
::
SmoothTransformation
);
else
bar
=
image
->
scaled
((
int
)
foo
.
width
(),
(
int
)
foo
.
height
(),
Qt
::
IgnoreAspectRatio
,
Qt
::
SmoothTransformation
);
// painter->drawPixmap(boundingRect(), *image, QRectF(0, 0, image->width(), image->height()));
painter
->
drawPixmap
(
boundingRect
(),
bar
,
bar
.
rect
());
if
(
isSelected
())
{
...
...
@@ -195,7 +199,8 @@ QVariant CardItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QV
// XXX
return
value
;
}
else
if
(
change
==
ItemSelectedHasChanged
)
{
update
();
qDebug
(
"selection changed"
);
update
(
boundingRect
());
return
value
;
}
else
return
QGraphicsItem
::
itemChange
(
change
,
value
);
...
...
cockatrice/src/gameview.cpp
View file @
9d6ecbbf
...
...
@@ -4,8 +4,8 @@ GameView::GameView(QGraphicsScene *scene, QWidget *parent)
:
QGraphicsView
(
scene
,
parent
)
{
setBackgroundBrush
(
QBrush
(
QColor
(
0
,
0
,
0
)));
setRenderHints
(
QPainter
::
Antialiasing
|
QPainter
::
SmoothPixmapTransform
);
setOptimizationFlags
(
/*DontClipPainter | */
DontSavePainterState
);
setRenderHints
(
QPainter
::
Antialiasing
/*
| QPainter::SmoothPixmapTransform
*/
);
//
setOptimizationFlags(/*DontClipPainter | */DontSavePainterState);
setDragMode
(
RubberBandDrag
);
}
...
...
cockatrice/src/libraryzone.cpp
View file @
9d6ecbbf
...
...
@@ -85,6 +85,9 @@ void LibraryZone::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
if
((
event
->
screenPos
()
-
event
->
buttonDownScreenPos
(
Qt
::
LeftButton
)).
manhattanLength
()
<
QApplication
::
startDragDistance
())
return
;
if
(
cards
->
empty
())
return
;
CardItem
*
card
=
cards
->
at
(
0
);
CardDragItem
*
drag
=
card
->
createDragItem
(
this
,
0
,
event
->
pos
(),
event
->
scenePos
());
drag
->
grabMouse
();
...
...
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