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

List:       kde-commits
Subject:    kdenonbeta/kig/objects
From:       Dominique Devriese <dominique.devriese () student ! kuleuven ! ac ! be>
Date:       2002-12-05 17:56:40
[Download RAW message or body]

CVS commit by domi: 

committing a patch by Maurizio Paolini fixing the new Line::getParam()
and getCoord() so that they
1 don't return NaN ( aka infinity )
2 work with the right range [0,1] instead of [-1,1]

CCMAIL:paolini@dmf.unicatt.it


  M +4 -1      line.cpp   1.45


--- kdenonbeta/kig/objects/line.cpp:1.44	Mon Dec  2 19:20:59 2002
@@ -55,6 +55,9 @@
   // we need to spread the points over the line, it should also come near
   // the (infinite) end of the line, but most points should be near
   // the two points we contain...
+  if ( p <= 0. ) p = 1e-6;
+  if ( p >= 1. ) p = 1 - 1e-6;
+  p = 2*p - 1;
   if (p > 0) p = p/(1 - p);
     else p = p/(1 + p);
 //  p *= 1024;    // such multiplying factor could be useful in order to
@@ -78,7 +81,7 @@
   if (p > 0) p = p/(1+p);
     else p = p/(1-p);
 
-  return p;
+  return 0.5*(p + 1);
 }
 
 LineTTP::~LineTTP()

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

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