summaryrefslogtreecommitdiff
path: root/includes/js/dojox/gfx/tests/test_decompose.html
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
commite44a7e37b6c7b5961adaffc62b9042b8d442938e (patch)
tree95b67c356e93163467db2451f2b8cce84ed5d582 /includes/js/dojox/gfx/tests/test_decompose.html
parenta62b9742ee5e28bcec6872d88f50f25b820914f6 (diff)
downloadsemanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.gz
semanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.bz2
New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/gfx/tests/test_decompose.html')
-rw-r--r--includes/js/dojox/gfx/tests/test_decompose.html54
1 files changed, 54 insertions, 0 deletions
diff --git a/includes/js/dojox/gfx/tests/test_decompose.html b/includes/js/dojox/gfx/tests/test_decompose.html
new file mode 100644
index 0000000..6291cc2
--- /dev/null
+++ b/includes/js/dojox/gfx/tests/test_decompose.html
@@ -0,0 +1,54 @@
+<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
+<head>
+<title>Testing decompose</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<style type="text/css">
+ @import "../../../dojo/resources/dojo.css";
+ @import "../../../dijit/tests/css/dijitTests.css";
+</style>
+<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true"></script>
+<script type="text/javascript" src="../matrix.js"></script>
+<script type="text/javascript" src="../decompose.js"></script>
+<script type="text/javascript">
+dojo.require("dojox.gfx.decompose");
+
+var m = dojox.gfx.matrix;
+
+var eq = function(a, b){
+ return Math.abs((a - b) / (a + b)) < 1e-6;
+};
+
+var calc = function(){
+ var matrix1 = eval("(m.normalize([" + dojo.byId("input").value + "]))");
+ dojo.byId("matrix1").value = dojo.toJson(matrix1, true);
+ var result = dojox.gfx.decompose(matrix1);
+ dojo.byId("result").innerHTML = "Result: " + dojo.toJson(result);
+ var matrix2 = m.normalize([
+ m.translate(result.dx, result.dy),
+ m.rotate(result.angle2),
+ m.scale(result.sx, result.sy),
+ m.rotate(result.angle1)
+ ]);
+ dojo.byId("matrix2").value = dojo.toJson(matrix2, true);
+};
+
+</script>
+</head>
+<body>
+ <h1>Testing decompose</h1>
+ <p>
+ <span style="font-size: 8pt;">Example: m.rotategAt(30, 100, 100), m.scaleAt(2, 3, 5, 5), m.rotate(45)</span><br />
+ <input id="input" type="text" size="50" maxlength="200" /><button onclick="calc();">Calc</button>
+ </p>
+ <p id="result">Result:</p>
+ <p>
+ <span style="font-size: 8pt;">Original matrix</span><br />
+ <textarea id="matrix1" cols="50" rows="8" readonly="readonly"></textarea>
+ </p>
+ <p>
+ <span style="font-size: 8pt;">Decomposed matrix</span><br />
+ <textarea id="matrix2" cols="50" rows="8" readonly="readonly"></textarea>
+ </p>
+ <p>That's all Folks!</p>
+</body>
+</html>