[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/marble/src/plugins/render/earthquake
From:       Torsten Rahn <tackat () kde ! org>
Date:       2010-12-26 11:48:07
Message-ID: 20101226114807.E1047AC80E () svn ! kde ! org
[Download RAW message or body]

SVN commit 1209307 by rahn:

Fixes: Proper origin for EarthquakeItems



 M  +3 -3      EarthquakeItem.cpp  


--- trunk/KDE/kdeedu/marble/src/plugins/render/earthquake/EarthquakeItem.cpp \
#1209306:1209307 @@ -81,7 +81,7 @@
     qreal height = magnitude() * 10;
 
     // Draws the circle with circles' center as rectangle's top-left corner.
-    QRect arcRect( width / -2, height / -2, width, height );
+    QRect arcRect( 0, 0, width, height );
     QColor color = oxygenBrickRed4;
     if ( magnitude() < 5.0 ) {
         color = oxygenSunYellow6;
@@ -102,7 +102,7 @@
         QPainter pixmapPainter( &m_seismograph );
         renderer.render( &pixmapPainter, QRectF( 0.0, 0.0, width, height ) );
     }
-    painter->drawPixmap( -width / 2, -height / 2, m_seismograph );
+    painter->drawPixmap( 0, 0, m_seismograph );
 
     // Draws magnitude of the earthquake
     QFontMetrics metrics( s_font );
@@ -111,7 +111,7 @@
     painter->setBrush( QBrush() );
     painter->setPen( QPen() );
     painter->setFont( s_font );
-    painter->drawText( QPoint( magnitudeRect.width() / -2, magnitudeRect.height() / \
2 ), magnitudeText ); +    painter->drawText( QPoint( (arcRect.width() - \
magnitudeRect.width()) / 2, (arcRect.height() - magnitudeRect.height()) / 2 + \
metrics.ascent() ), magnitudeText );  
     // Restore the old painter state.
     painter->restore();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic