From 951549550e91e86a45efad901133fb2e5304079a Mon Sep 17 00:00:00 2001 From: Carsten Niehaus Date: Sun, 5 Jun 2005 11:09:23 +0000 Subject: [PATCH] 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 --- kalzium/src/element.cpp | 6 +++--- kalzium/src/element.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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 ); /** -- 2.47.3