From: Carsten Niehaus Date: Sun, 5 Jun 2005 11:09:23 +0000 (+0000) Subject: strip the values in the gradient after the 4th digit. X-Git-Tag: v3.80.2~300^2~121 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=951549550e91e86a45efad901133fb2e5304079a;p=libqmvoc.git strip the values in the gradient after the 4th digit. Otherwise they where much to long in some cases svn path=/trunk/KDE/kdeedu/kalzium/src/element.cpp; revision=422389 --- diff --git a/kalzium/src/element.cpp b/kalzium/src/element.cpp index 3c19686..7912289 100644 --- a/kalzium/src/element.cpp +++ b/kalzium/src/element.cpp @@ -55,7 +55,7 @@ QString Element::parsedOrbits( bool canBeEmpty ) } -double Element::strippedMass( double num ) +double Element::strippedValue( double num ) { if ( !finite( num ) ) return num; @@ -342,7 +342,7 @@ void Element::drawStateOfMatter( QPainter* p, double temp ) //top left p->setPen( Qt::black ); - text = QString::number( strippedMass( mass( ) ) ); + text = QString::number( strippedValue( mass( ) ) ); p->drawText( X,Y ,ELEMENTSIZE,h_small,Qt::AlignCenter, text ); text = QString::number( number() ); @@ -444,7 +444,7 @@ void Element::drawSelf( QPainter* p ) //top left p->setPen( Qt::black ); - text = QString::number( strippedMass( mass( ) ) ); + text = QString::number( strippedValue( mass( ) ) ); p->drawText( X,Y ,ELEMENTSIZE,h_small,Qt::AlignCenter, text ); text = QString::number( number() ); diff --git a/kalzium/src/element.h b/kalzium/src/element.h index c3da100..1690814 100644 --- a/kalzium/src/element.h +++ b/kalzium/src/element.h @@ -347,7 +347,7 @@ class Element{ /** * calculate the 4-digit value of the value @p w */ - double strippedMass( double w ); + static double strippedValue( double w ); /**