]> Git trees. - libqmvoc.git/commitdiff
fix logic here, I was doing it the wrong way around
authorCarsten Niehaus <cniehaus@gmx.de>
Tue, 17 Oct 2006 13:55:41 +0000 (13:55 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Tue, 17 Oct 2006 13:55:41 +0000 (13:55 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=596434

libscience/spectrum.cpp
libscience/spectrum.h

index d3c1b0cd9d82e762e42e00ed54a89b1074a11ee7..0793ed9dae49ee9e4e6561f98ff72688a4e91559 100644 (file)
@@ -18,7 +18,6 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ***************************************************************************/
 #include "spectrum.h"
-
 #include "element.h"
 
 #include <klocale.h>
@@ -77,12 +76,10 @@ void Spectrum::adjustIntensities()
        //check if an adjustment is needed or not
        if ( maxInt == 1000 ) return;
 
-       const double max = ( double ) maxInt;
-
        //now adjust the intensities.
        foreach ( Spectrum::peak * p, m_peaklist)
        {
-               double newInt = max*1000/p->intensity;
+               double newInt = p->intensity*1000/maxInt;
 
                p->intensity = ( int ) round( newInt );
        }
index cf06565a8f6b667714d495abb653796598be87ef..5f6410300e875de3a2cd384f1e440d466e9f8a48 100644 (file)
@@ -24,7 +24,6 @@
 #include <libkdeedu_science_export.h>
 
 #include <QList>
-#include <QString>
 
 class Element;