From 19d341250ca5c5f21ea278ebdc7050c5400e951f Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 30 Apr 2002 14:04:05 +0000 Subject: - no default arguments in method impls --- diff --git a/noncore/games/solitaire/canvascardgame.cpp b/noncore/games/solitaire/canvascardgame.cpp index 32635a0..ef35287 100644 --- a/noncore/games/solitaire/canvascardgame.cpp +++ b/noncore/games/solitaire/canvascardgame.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -71,14 +72,18 @@ private: void CanvasCardPile::addCard( CanvasCard *card ) { + int offsetDown = ( qt_screen->deviceWidth() < 200 ) ? 9 : 13; + int cardHeight = ( qt_screen->deviceWidth() < 200 ) ? 27 : 36; + int cardWidth = ( qt_screen->deviceWidth() < 200 ) ? 20 : 23; + if ( !firstCard ) firstCard = card; - int height = 36 + pileHeight * 13; - setSize( 23, height ); - pile->resize( 23, height ); + int height = cardHeight + pileHeight * offsetDown; + setSize( cardWidth, height ); + pile->resize( cardWidth, height ); QPainter p( pile ); - p.translate( -card->x(), -card->y() + pileHeight * 13 ); + p.translate( -card->x(), -card->y() + pileHeight * offsetDown ); card->draw( p ); pileHeight++; @@ -99,17 +104,17 @@ void CanvasCardPile::addCard( CanvasCard *card ) tempImage32.setPixel( 0, 0, alpha ); tempImage32.setPixel( 0, 1, alpha ); - tempImage32.setPixel( 21, 0, alpha ); - tempImage32.setPixel( 22, 0, alpha ); - tempImage32.setPixel( 22, 1, alpha ); + tempImage32.setPixel( cardWidth - 2, 0, alpha ); + tempImage32.setPixel( cardWidth - 1, 0, alpha ); + tempImage32.setPixel( cardWidth - 1, 1, alpha ); height--; tempImage32.setPixel( 1, height, alpha ); tempImage32.setPixel( 0, height - 1, alpha ); tempImage32.setPixel( 0, height, alpha ); - tempImage32.setPixel( 21, height, alpha ); - tempImage32.setPixel( 22, height, alpha ); - tempImage32.setPixel( 22, height - 1, alpha ); + tempImage32.setPixel( cardWidth - 2, height, alpha ); + tempImage32.setPixel( cardWidth - 1, height, alpha ); + tempImage32.setPixel( cardWidth - 1, height - 1, alpha ); } @@ -133,7 +138,7 @@ void CanvasCardPile::advance(int stage) } -void CanvasCardPile::animatedMove(int x2, int y2, int steps = 7 ) +void CanvasCardPile::animatedMove(int x2, int y2, int steps ) { destX = x2; destY = y2; -- cgit v0.9.0.2