All pastes #450415 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-04-20 20:46 UTC
rendered paste body
From 9924eebe3f36ff144a4895880f9b732f1642d8ed Mon Sep 17 00:00:00 2001
From: Roi Cohen <roico@roico-desktop.(none)>
Date: Fri, 20 Apr 2007 16:07:44 +0300
Subject: [PATCH] correct-vertical-rotation

---
 src/paint.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/paint.c b/src/paint.c
index c2609bd..39fdd9e 100644
--- a/src/paint.c
+++ b/src/paint.c
@@ -44,6 +44,8 @@ preparePaintScreen (CompScreen *screen,
 void
 donePaintScreen (CompScreen *screen) {}
 
+#define DEG2RAD (M_PI / 180.0f)
+
 void
 applyScreenTransform (CompScreen	      *screen,
 		      const ScreenPaintAttrib *sAttrib,
@@ -58,9 +60,9 @@ applyScreenTransform (CompScreen	      *screen,
 		  sAttrib->xRotate, 0.0f, 1.0f, 0.0f);
     matrixRotate (transform,
 		  sAttrib->vRotate,
-		  1.0f - sAttrib->xRotate / 90.0f,
+		  cos(sAttrib->xRotate * DEG2RAD),
 		  0.0f,
-		  sAttrib->xRotate / 90.0f);
+		  sin(sAttrib->xRotate * DEG2RAD));
     matrixRotate (transform,
 		  sAttrib->yRotate, 0.0f, 1.0f, 0.0f);
 }
-- 
1.4.4.2