Mercurial > hg > digilib
comparison client/digitallibrary/jquery/dlGeometry.js @ 620:b930fa64c684 jquery
scalerImgLoaded sets up img trafo
author | robcast |
---|---|
date | Mon, 17 Jan 2011 23:57:09 +0100 |
parents | 0d6fa11f7f98 |
children | a2aadf44a454 8f76bd79648e |
comparison
equal
deleted
inserted
replaced
619:1035891fb6f1 | 620:b930fa64c684 |
---|---|
195 * Transform class | 195 * Transform class |
196 * | 196 * |
197 * defines a class of affine transformations | 197 * defines a class of affine transformations |
198 */ | 198 */ |
199 var transform = function (spec) { | 199 var transform = function (spec) { |
200 var that = { | 200 var that = jQuery.extend({ |
201 m00 : spec.m00 || 1.0, | 201 m00 : 1.0, |
202 m01 : spec.m01 || 0.0, | 202 m01 : 0.0, |
203 m02 : spec.m02 || 0.0, | 203 m02 : 0.0, |
204 m10 : spec.m10 || 0.0, | 204 m10 : 0.0, |
205 m11 : spec.m11 || 1.0, | 205 m11 : 1.0, |
206 m12 : spec.m12 || 0.0, | 206 m20 : 0.0, |
207 m20 : spec.m20 || 0.0, | 207 m12 : 0.0, |
208 m21 : spec.m21 || 0.0, | 208 m21 : 0.0, |
209 m22 : spec.m22 || 1.0 | 209 m22 : 1.0 |
210 }; | 210 }, spec); |
211 that.concat = function(traf) { | 211 that.concat = function(traf) { |
212 // add Transform traf to this Transform | 212 // add Transform traf to this Transform |
213 for (var i = 0; i < 3; i++) { | 213 for (var i = 0; i < 3; i++) { |
214 for (var j = 0; j < 3; j++) { | 214 for (var j = 0; j < 3; j++) { |
215 var c = 0.0; | 215 var c = 0.0; |
250 var height = y2 - y; | 250 var height = y2 - y; |
251 return rectangle(x, y, width, height); | 251 return rectangle(x, y, width, height); |
252 } | 252 } |
253 return position(x, y); | 253 return position(x, y); |
254 }; | 254 }; |
255 that.getRotation = getRotation; | 255 that.getRotation = transform.getRotation; |
256 that.getTranslation = getTranslation; | 256 that.getTranslation = transform.getTranslation; |
257 that.getScale = getScale; | 257 that.getScale = transform.getScale; |
258 | 258 |
259 return that; | 259 return that; |
260 }; | 260 }; |
261 | 261 |
262 transform.getRotation = function (angle, pos) { | 262 transform.getRotation = function (angle, pos) { |