[poppler] poppler/Function.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Feb 9 04:38:07 PST 2008


 poppler/Function.cc |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c8f734ba4258059fa4521a4d364f62ca1632840b
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Feb 9 13:37:04 2008 +0100

    PS cos and sin input values are degrees so convert to radians so we can use the cos and sin cmath functions

diff --git a/poppler/Function.cc b/poppler/Function.cc
index 9a9951a..dfaf04c 100644
--- a/poppler/Function.cc
+++ b/poppler/Function.cc
@@ -1331,7 +1331,7 @@ void PostScriptFunction::exec(PSStack *stack, int codePtr) {
 	stack->copy(stack->popInt());
 	break;
       case psOpCos:
-	stack->pushReal(cos(stack->popNum()));
+	stack->pushReal(cos(stack->popNum() * M_PI / 180.0));
 	break;
       case psOpCvi:
 	if (!stack->topIsInt()) {
@@ -1512,7 +1512,7 @@ void PostScriptFunction::exec(PSStack *stack, int codePtr) {
 	}
 	break;
       case psOpSin:
-	stack->pushReal(sin(stack->popNum()));
+	stack->pushReal(sin(stack->popNum() * M_PI / 180.0));
 	break;
       case psOpSqrt:
 	stack->pushReal(sqrt(stack->popNum()));


More information about the poppler mailing list