aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindex.html4
-rwxr-xr-xjs/controllers/elements/shapes-controller.js34
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js2
-rw-r--r--manifest.json2
-rw-r--r--os.html48
5 files changed, 73 insertions, 17 deletions
diff --git a/index.html b/index.html
index e9b2d1ee..7c852357 100755
--- a/index.html
+++ b/index.html
@@ -178,6 +178,10 @@ POSSIBILITY OF SUCH DAMAGE.
178 178
179 <script type="text/javascript"> 179 <script type="text/javascript">
180 window.onload = function() { 180 window.onload = function() {
181 //Check for OS support
182 if (navigator.appVersion.toLowerCase().indexOf("win") === -1 && navigator.appVersion.toLowerCase().indexOf("mac") === -1) {
183 window.location = "./os.html";
184 }
181 // Check if we are running in Chrome 185 // Check if we are running in Chrome
182 if(navigator.userAgent.toLowerCase().indexOf("chrome") === -1) { 186 if(navigator.userAgent.toLowerCase().indexOf("chrome") === -1) {
183 window.location = "./redirect.html"; 187 window.location = "./redirect.html";
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index 6dabff47..ad0f40a2 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -56,10 +56,11 @@ exports.ShapesController = Montage.create(CanvasController, {
56 { 56 {
57 // Changing stroke size should grow/shrink the shape from the center. 57 // Changing stroke size should grow/shrink the shape from the center.
58 var delta = ~~(val - el.elementModel.shapeModel.GLGeomObj.getStrokeWidth()), 58 var delta = ~~(val - el.elementModel.shapeModel.GLGeomObj.getStrokeWidth()),
59 l = this.application.ninja.elementMediator.getProperty(el, "left", parseInt), 59 ol = this.application.ninja.elementMediator.getProperty(el, "left", parseInt),
60 t = this.application.ninja.elementMediator.getProperty(el, "top", parseInt), 60 ot = this.application.ninja.elementMediator.getProperty(el, "top", parseInt),
61 w = this.application.ninja.elementMediator.getProperty(el, "width", parseInt), 61 ow = this.application.ninja.elementMediator.getProperty(el, "width", parseInt),
62 h = this.application.ninja.elementMediator.getProperty(el, "height", parseInt); 62 oh = this.application.ninja.elementMediator.getProperty(el, "height", parseInt),
63 l, t, w, h;
63 64
64 if(geomType === 3) 65 if(geomType === 3)
65 { 66 {
@@ -68,12 +69,12 @@ exports.ShapesController = Montage.create(CanvasController, {
68 if(slope === "horizontal") 69 if(slope === "horizontal")
69 { 70 {
70 h = Math.max(val, 1); 71 h = Math.max(val, 1);
71 t -= ~~(delta/2); 72 t = ot - ~~(delta/2);
72 } 73 }
73 else if(slope === "vertical") 74 else if(slope === "vertical")
74 { 75 {
75 w = Math.max(val, 1); 76 w = Math.max(val, 1);
76 l -= ~~(delta/2); 77 l = ol - ~~(delta/2);
77 } 78 }
78 else 79 else
79 { 80 {
@@ -85,10 +86,10 @@ exports.ShapesController = Montage.create(CanvasController, {
85 var dX = ~~(xAdj*2 - oldXAdj*2); 86 var dX = ~~(xAdj*2 - oldXAdj*2);
86 var dY = ~~(yAdj*2 - oldYAdj*2); 87 var dY = ~~(yAdj*2 - oldYAdj*2);
87 88
88 l -= dX; 89 l = ol - dX;
89 t -= dY; 90 t = ot - dY;
90 w += dX*2; 91 w = ow + dX*2;
91 h += dY*2; 92 h = oh + dY*2;
92 93
93 el.elementModel.shapeModel.GLGeomObj.setXAdj(xAdj); 94 el.elementModel.shapeModel.GLGeomObj.setXAdj(xAdj);
94 el.elementModel.shapeModel.GLGeomObj.setYAdj(yAdj); 95 el.elementModel.shapeModel.GLGeomObj.setYAdj(yAdj);
@@ -96,13 +97,16 @@ exports.ShapesController = Montage.create(CanvasController, {
96 } 97 }
97 else 98 else
98 { 99 {
99 l -= ~~(delta/2); 100 l = ol - ~~(delta/2);
100 t -= ~~(delta/2); 101 t = ot - ~~(delta/2);
101 w += delta; 102 w = ow + delta;
102 h += delta; 103 h = oh + delta;
103 } 104 }
104 105
105 this.application.ninja.elementMediator.setProperties([{element:el, properties:{left: l + "px", top: t + "px", width: w + "px", height:h + "px"}}], eventType, source); 106 this.application.ninja.elementMediator.setProperties([{element:el,
107 properties:{left: l + "px", top: t + "px", width: w + "px", height: h + "px"},
108 previousProperties:{left: ol + "px", top: ot + "px", width: ow + "px", height: oh + "px"}}],
109 eventType, source);
106 110
107 } 111 }
108 el.elementModel.shapeModel.GLGeomObj.setStrokeWidth(val); 112 el.elementModel.shapeModel.GLGeomObj.setStrokeWidth(val);
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js
index b59bbf39..11c27b03 100755
--- a/js/helper-classes/3D/draw-utils.js
+++ b/js/helper-classes/3D/draw-utils.js
@@ -326,7 +326,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
326 eltModel = elt.elementModel; 326 eltModel = elt.elementModel;
327 eltModel.setProperty("offsetCache", false); 327 eltModel.setProperty("offsetCache", false);
328 328
329 if(eltModel.selection !== "body") { 329 if(eltModel.pi !== "bodyPi") {
330 if(isChanging) { 330 if(isChanging) {
331 eltModel.props3D.matrix3d = null; 331 eltModel.props3D.matrix3d = null;
332 } else { 332 } else {
diff --git a/manifest.json b/manifest.json
index 14d8b239..8c9e8a66 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,7 +1,7 @@
1{ 1{
2 "name": "Ninja Authoring Tool Preview", 2 "name": "Ninja Authoring Tool Preview",
3 "description": "Ninja HTML5 Authoring Tool Preview", 3 "description": "Ninja HTML5 Authoring Tool Preview",
4 "version": "0.8.0.0", 4 "version": "0.7.1.0",
5 "app": { 5 "app": {
6 "launch": { 6 "launch": {
7 "local_path": "index.html" 7 "local_path": "index.html"
diff --git a/os.html b/os.html
new file mode 100644
index 00000000..703c2b0d
--- /dev/null
+++ b/os.html
@@ -0,0 +1,48 @@
1<!DOCTYPE html>
2<!-- <copyright>
3Copyright (c) 2012, Motorola Mobility LLC.
4All Rights Reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8
9* Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11
12* Redistributions in binary form must reproduce the above copyright notice,
13 this list of conditions and the following disclaimer in the documentation
14 and/or other materials provided with the distribution.
15
16* Neither the name of Motorola Mobility LLC nor the names of its
17 contributors may be used to endorse or promote products derived from this
18 software without specific prior written permission.
19
20THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30POSSIBILITY OF SUCH DAMAGE.
31</copyright> -->
32<html>
33
34<head>
35
36 <title>Ninja - OS Support</title>
37
38</head>
39
40<body>
41
42 <div>
43 <p>Your operating system is currently not supported by Ninja. Please visit <a href="http://tetsubo.org/home/ninja/system-requirements/">Tetsubo</a> for more information on system requirements and more information.</p>
44 </div>
45
46</body>
47
48</html>