diff client/digitallibrary/jquery/dlGeometry.js @ 627:c2566e470569 jquery

scalerImgLoaded sets up img trafo
author robcast
date Mon, 17 Jan 2011 23:57:09 +0100
parents 8204615dad77
children b3c05e1568cf 72acc47f1831
line wrap: on
line diff
--- a/client/digitallibrary/jquery/dlGeometry.js	Mon Jan 17 22:10:12 2011 +0100
+++ b/client/digitallibrary/jquery/dlGeometry.js	Mon Jan 17 23:57:09 2011 +0100
@@ -197,17 +197,17 @@
  * defines a class of affine transformations
  */
         var transform = function (spec) {
-            var that = {
-                    m00 : spec.m00 || 1.0,
-                    m01 : spec.m01 || 0.0,
-                    m02 : spec.m02 || 0.0,
-                    m10 : spec.m10 || 0.0,
-                    m11 : spec.m11 || 1.0,
-                    m12 : spec.m12 || 0.0,
-                    m20 : spec.m20 || 0.0,
-                    m21 : spec.m21 || 0.0,
-                    m22 : spec.m22 || 1.0
-            };
+            var that = jQuery.extend({
+                    m00 : 1.0,
+                    m01 : 0.0,
+                    m02 : 0.0,
+                    m10 : 0.0,
+                    m11 : 1.0,
+                    m20 : 0.0,
+                    m12 : 0.0,
+                    m21 : 0.0,
+                    m22 : 1.0
+            }, spec);
             that.concat = function(traf) {
                 // add Transform traf to this Transform
                 for (var i = 0; i < 3; i++) {
@@ -252,9 +252,9 @@
                 }
                 return position(x, y);
             };
-            that.getRotation = getRotation;
-            that.getTranslation = getTranslation;
-            that.getScale = getScale;
+            that.getRotation = transform.getRotation;
+            that.getTranslation = transform.getTranslation;
+            that.getScale = transform.getScale;
             
             return that;
         };