summaryrefslogtreecommitdiff
path: root/includes/js/dojox/gfx/tests/decompose.js
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
commit1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch)
tree3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojox/gfx/tests/decompose.js
parent104d59099e048688c4dbac37d72137006e396558 (diff)
downloadsemanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz
semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.bz2
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/gfx/tests/decompose.js')
-rw-r--r--includes/js/dojox/gfx/tests/decompose.js114
1 files changed, 0 insertions, 114 deletions
diff --git a/includes/js/dojox/gfx/tests/decompose.js b/includes/js/dojox/gfx/tests/decompose.js
deleted file mode 100644
index b488bdd..0000000
--- a/includes/js/dojox/gfx/tests/decompose.js
+++ /dev/null
@@ -1,114 +0,0 @@
-if(!dojo._hasResource["dojox.gfx.tests.decompose"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojox.gfx.tests.decompose"] = true;
-dojo.provide("dojox.gfx.tests.decompose");
-dojo.require("dojox.gfx.decompose");
-
-(function(){
- var m = dojox.gfx.matrix;
- var eq = function(t, a, b){ t.t(2 * Math.abs(a - b) / ((a < 1 && b < 1) ? 1 : a + b) < 1e-6); };
- var eqM = function(t, a, b){
- eq(t, a.xx, b.xx);
- eq(t, a.yy, b.yy);
- eq(t, a.xy, b.xy);
- eq(t, a.yx, b.yx);
- eq(t, a.dx, b.dx);
- eq(t, a.dy, b.dy);
- };
- var compose = function(r){
- return m.normalize([
- m.translate(r.dx, r.dy),
- m.rotate(r.angle2),
- m.scale(r.sx, r.sy),
- m.rotate(r.angle1)
- ]);
- };
- var reconstruct = function(a){
- return compose(dojox.gfx.decompose(a));
- };
- var compare = function(t, a){
- var A = m.normalize(a);
- eqM(t, A, reconstruct(A));
- };
- tests.register("dojox.gfx.tests.decompose", [
- function IdentityTest(t){
- compare(t, m.identity);
- },
- function FlipXTest(t){
- compare(t, m.flipX);
- },
- function FlipYTest(t){
- compare(t, m.flipY);
- },
- function FlipXYTest(t){
- compare(t, m.flipXY);
- },
- function TranslationTest(t){
- compare(t, m.translate(45, -15));
- },
- function RotationTest(t){
- compare(t, m.rotateg(35));
- },
- function SkewXTest(t){
- compare(t, m.skewXg(35));
- },
- function SkewYTest(t){
- compare(t, m.skewYg(35));
- },
- function ReflectTest(t){
- compare(t, m.reflect(13, 27));
- },
- function ProjectTest(t){
- compare(t, m.project(13, 27));
- },
- function ScaleTest1(t){
- compare(t, m.scale(3));
- },
- function ScaleTest2(t){
- compare(t, m.scale(3, -1));
- },
- function ScaleTest3(t){
- compare(t, m.scale(-3, 1));
- },
- function ScaleTest4(t){
- compare(t, m.scale(-3, -1));
- },
- function ScaleRotateTest1(t){
- compare(t, [m.scale(3), m.rotateAt(35, 13, 27)]);
- },
- function ScaleRotateTest2(t){
- compare(t, [m.scale(3, -1), m.rotateAt(35, 13, 27)]);
- },
- function ScaleRotateTest3(t){
- compare(t, [m.scale(-3, 1), m.rotateAt(35, 13, 27)]);
- },
- function ScaleRotateTest4(t){
- compare(t, [m.scale(-3, -1), m.rotateAt(35, 13, 27)]);
- },
- function RotateScaleTest1(t){
- compare(t, [m.rotateAt(35, 13, 27), m.scale(3)]);
- },
- function RotateScaleTest2(t){
- compare(t, [m.rotateAt(35, 13, 27), m.scale(3, -1)]);
- },
- function RotateScaleTest3(t){
- compare(t, [m.rotateAt(35, 13, 27), m.scale(-3, 1)]);
- },
- function RotateScaleTest4(t){
- compare(t, [m.rotateAt(35, 13, 27), m.scale(-3, -1)]);
- },
- function RotateScaleRotateTest1(t){
- compare(t, [m.rotateAt(35, 13, 27), m.scale(3), m.rotateAt(-15, 163, -287)]);
- },
- function RotateScaleRotateTest2(t){
- compare(t, [m.rotateAt(35, 13, 27), m.scale(3, -1), m.rotateAt(-15, 163, -287)]);
- },
- function RotateScaleRotateTest3(t){
- compare(t, [m.rotateAt(35, 13, 27), m.scale(-3, 1), m.rotateAt(-15, 163, -287)]);
- },
- function RotateScaleRotateTest4(t){
- compare(t, [m.rotateAt(35, 13, 27), m.scale(-3, -1), m.rotateAt(-15, 163, -287)]);
- }
- ]);
-})();
-
-}