From kde-commits Thu Dec 05 17:56:40 2002 From: Dominique Devriese Date: Thu, 05 Dec 2002 17:56:40 +0000 To: kde-commits Subject: kdenonbeta/kig/objects X-MARC-Message: https://marc.info/?l=kde-commits&m=103911108602927 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()