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

List:       kde-commits
Subject:    branches/KDE/3.5/kdegraphics/kpdf/xpdf/xpdf
From:       Albert Astals Cid <tsdgeos () terra ! es>
Date:       2008-02-09 11:24:59
Message-ID: 1202556299.421766.19665.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 772669 by aacid:

atan operator must yield a degrees result between 0 and 360

BUG: 157497


 M  +4 -2      Function.cc  


--- branches/KDE/3.5/kdegraphics/kpdf/xpdf/xpdf/Function.cc #772668:772669
@@ -1261,7 +1261,7 @@
 
 void PostScriptFunction::exec(PSStack *stack, int codePtr) {
   int i1, i2;
-  double r1, r2;
+  double r1, r2, result;
   GBool b1, b2;
 
   while (1) {
@@ -1306,7 +1306,9 @@
       case psOpAtan:
 	r2 = stack->popNum();
 	r1 = stack->popNum();
-	stack->pushReal(atan2(r1, r2));
+	result = atan2(r1, r2) * 180.0 / M_PI;
+	if (result < 0) result += 360.0;
+	stack->pushReal(result);
 	break;
       case psOpBitshift:
 	i2 = stack->popInt();
[prev in list] [next in list] [prev in thread] [next in thread] 

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