summaryrefslogtreecommitdiff
authorsandman <sandman>2002-12-22 16:39:25 (UTC)
committer sandman <sandman>2002-12-22 16:39:25 (UTC)
commitf86b3c6613548c9f59019892233f5f90a17d472c (patch) (side-by-side diff)
tree1d5c999b02986b2071cbc70122542dae3cb3037f
parent5fc02331096bdb38de080cd55b83350a95306cca (diff)
downloadopie-f86b3c6613548c9f59019892233f5f90a17d472c.zip
opie-f86b3c6613548c9f59019892233f5f90a17d472c.tar.gz
opie-f86b3c6613548c9f59019892233f5f90a17d472c.tar.bz2
small fix
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/tools/clock/clock.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp
index d69c56f..2f81c3a 100644
--- a/noncore/tools/clock/clock.cpp
+++ b/noncore/tools/clock/clock.cpp
@@ -464,49 +464,49 @@ void AnalogClock::drawContents( QPainter *p )
if ( clear ) {
erase ( r );
p-> setPen ( NoPen );
p-> setBrush ( colorGroup ( ). color ( QColorGroup::Base ));
p-> drawEllipse ( fr );
p-> setBrush ( NoBrush );
// draw ticks
p->setPen( QPen( colorGroup ( ). color ( QColorGroup::Text ), 1 ) );
for ( int i = 0; i < 12; i++ )
p->drawLine( rotate( center, l1, i * 30 ), rotate( center, l2, i * 30 ) );
}
else {
drawPointers ( p, fr, colorGroup ( ). color ( QColorGroup::Base ), prevTime, &currTime );
}
drawPointers ( p, fr, colorGroup ( ). color ( QColorGroup::Text ), currTime );
prevTime = currTime;
}
void AnalogClock::drawPointers ( QPainter *p, const QRect &r, const QColor &c, const QTime &t, const QTime *t2 )
{
- QPoint center( r.x() + r.width() / 2, r.y() + r.height() / 2 );
+ QPoint center = r. center ( );
QPoint h1( center. x ( ), r. y ( ) + r. height ( ) / 4 );
QPoint h2( center. x ( ), center. y ( ) );
QPoint m1( center. x ( ), r.y() + r.height() / 8 );
QPoint m2( center. x ( ), center. y ( ) );
QPoint s1( center. x ( ), r. y ( ) + 8 );
QPoint s2( center. x ( ), center. y ( ) );
if ( !t2 || ( t. minute ( ) != t2-> minute ( ) || t. hour ( ) != t2-> hour ( ))) {
// draw hour pointer
h1 = rotate( center, h1, 30 * ( t.hour() % 12 ) + t.minute() / 2 );
h2 = rotate( center, h2, 30 * ( t.hour() % 12 ) + t.minute() / 2 );
p-> setPen ( QPen ( c, 3 ));
p-> drawLine ( h1, h2 );
}
if ( !t2 || ( t. minute ( ) != t2-> minute ( ))) {
// draw minute pointer
m1 = rotate( center, m1, t.minute() * 6 );
m2 = rotate( center, m2, t.minute() * 6 );
p-> setPen ( QPen ( c, 2 ));