changeset 671:a53c3e12995a jquery

still working on correct transform for rotations... (still doesn't)
author robcast
date Tue, 25 Jan 2011 11:01:45 +0100
parents 11d96bc0ac09
children 7f7536a5b6d9
files client/digitallibrary/jquery/dlGeometry.js client/digitallibrary/jquery/jquery.digilib.js
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/jquery/dlGeometry.js	Mon Jan 24 23:07:57 2011 +0100
+++ b/client/digitallibrary/jquery/dlGeometry.js	Tue Jan 25 11:01:45 2011 +0100
@@ -245,9 +245,10 @@
                     for (var j = 0; j < 3; j++) {
                         var c = 0.0;
                         for (var k = 0; k < 3; k++) {
-                            c += traf["m"+i.toString()+k.toString()] * this["m"+k.toString()+j.toString()];
+                            c += traf["m"+i+k] * this["m"+k+j];
+                            //c += this["m"+i.toString()+k.toString()] * traf["m"+k.toString()+j.toString()];
                         }
-                        this["m"+i.toString()+j.toString()] = c;
+                        this["m"+i+j] = c;
                     }
                 }
                 return this;
--- a/client/digitallibrary/jquery/jquery.digilib.js	Mon Jan 24 23:07:57 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js	Tue Jan 25 11:01:45 2011 +0100
@@ -798,9 +798,14 @@
         trafo.concat(trafo.getScale(geom.size(1/area.width, 1/area.height)));
         // rotate
         if (data) {
-            var rot = trafo.getRotationAround(-parseFloat(data.settings.rot), 
-                    geom.position(0.5 * area.width + area.x, 0.5 * area.height + area.y));
+            /* var rot = trafo.getRotationAround(parseFloat(data.settings.rot), 
+                    geom.position(0.5 * area.width + area.x, 0.5 * area.height + area.y)); */
+            var rot = trafo.getRotation(parseFloat(data.settings.rot));
+            var trans1 = trafo.getTranslation(geom.position(-0.5 * area.width + area.x, -0.5 * area.height + area.y));
+            var trans2 = trafo.getTranslation(geom.position(0.5 * area.width + area.x, 0.5 * area.height + area.y));
+            trafo.concat(trans1);
             trafo.concat(rot);
+            trafo.concat(trans2);
         }
         // scale to screen position and size
         trafo.concat(trafo.getScale(picrect));