diff options
author | Valerio Virgillito | 2012-04-12 18:07:54 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-04-12 18:07:54 -0700 |
commit | 5b4826eced782fe7b4691d4bbbe0e3605d3164c1 (patch) | |
tree | a1fe692c814d75f05da466eead26579e4686175d /js/tools | |
parent | 6885e66a1f668f34699145f0da231c5d4ecbe666 (diff) | |
parent | 4b900ea5cd6bb77eb30cec8c03b9ec9fa662c1e9 (diff) | |
download | ninja-5b4826eced782fe7b4691d4bbbe0e3605d3164c1.tar.gz |
Merge branch 'refs/heads/master' into undo-manager
Conflicts:
js/controllers/elements/element-controller.js
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/tools')
-rwxr-xr-x | js/tools/ShapeTool.js | 2 | ||||
-rwxr-xr-x | js/tools/TagTool.js | 2 | ||||
-rwxr-xr-x | js/tools/drawing-tool-base.js | 9 |
3 files changed, 8 insertions, 5 deletions
diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js index a8da7921..f3b5e92d 100755 --- a/js/tools/ShapeTool.js +++ b/js/tools/ShapeTool.js | |||
@@ -197,7 +197,7 @@ exports.ShapeTool = Montage.create(DrawingTool, { | |||
197 | 'top' : top + 'px', | 197 | 'top' : top + 'px', |
198 | 'left' : left + 'px', | 198 | 'left' : left + 'px', |
199 | '-webkit-transform-style' : 'preserve-3d', | 199 | '-webkit-transform-style' : 'preserve-3d', |
200 | '-webkit-transform' : 'perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)' | 200 | '-webkit-transform' : 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)' |
201 | }; | 201 | }; |
202 | 202 | ||
203 | tmpDiv.width = w; | 203 | tmpDiv.width = w; |
diff --git a/js/tools/TagTool.js b/js/tools/TagTool.js index 752500e0..d946db72 100755 --- a/js/tools/TagTool.js +++ b/js/tools/TagTool.js | |||
@@ -256,7 +256,7 @@ exports.TagTool = Montage.create(DrawingTool, { | |||
256 | value: function(tag) { | 256 | value: function(tag) { |
257 | var styles = { | 257 | var styles = { |
258 | "-webkit-transform-style": "preserve-3d", | 258 | "-webkit-transform-style": "preserve-3d", |
259 | "-webkit-transform": "perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)" | 259 | "-webkit-transform": "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)" |
260 | }; | 260 | }; |
261 | tag.innerHTML = "content"; | 261 | tag.innerHTML = "content"; |
262 | 262 | ||
diff --git a/js/tools/drawing-tool-base.js b/js/tools/drawing-tool-base.js index 84602186..476dca66 100755 --- a/js/tools/drawing-tool-base.js +++ b/js/tools/drawing-tool-base.js | |||
@@ -227,7 +227,7 @@ exports.DrawingToolBase = Montage.create(Montage, { | |||
227 | //var planeMatInv = planeMat.inverse(); | 227 | //var planeMatInv = planeMat.inverse(); |
228 | var planeMatInv = glmat4.inverse( planeMat, [] ); | 228 | var planeMatInv = glmat4.inverse( planeMat, [] ); |
229 | //var midPt = this.unprojectPoints( s0, s1, planeMat, planeMatInv, s1Proj ); | 229 | //var midPt = this.unprojectPoints( s0, s1, planeMat, planeMatInv, s1Proj ); |
230 | var midPt = this.unprojectPoints( s0, s1, planeMat, planeMatInv, true ); | 230 | // var midPt = this.unprojectPoints( s0, s1, planeMat, planeMatInv, true ); |
231 | 231 | ||
232 | // get the 4 points of the bounding box in 2D space | 232 | // get the 4 points of the bounding box in 2D space |
233 | p0 = MathUtils.transformPoint( s0, planeMatInv ); | 233 | p0 = MathUtils.transformPoint( s0, planeMatInv ); |
@@ -237,7 +237,7 @@ exports.DrawingToolBase = Montage.create(Montage, { | |||
237 | //midPt = s0.add(s1); | 237 | //midPt = s0.add(s1); |
238 | //midPt = midPt.multiply(0.5); | 238 | //midPt = midPt.multiply(0.5); |
239 | //midPt = MathUtils.makeDimension3(midPt); | 239 | //midPt = MathUtils.makeDimension3(midPt); |
240 | midPt = vec3.add(s0, s1, []); | 240 | var midPt = vec3.add(s0, s1, []); |
241 | midPt = vecUtils.vecScale( 3, midPt, 0.5 ); | 241 | midPt = vecUtils.vecScale( 3, midPt, 0.5 ); |
242 | 242 | ||
243 | // the mid point is now relative to the center of the 3D space. To | 243 | // the mid point is now relative to the center of the 3D space. To |
@@ -371,6 +371,9 @@ exports.DrawingToolBase = Montage.create(Montage, { | |||
371 | // determine if the geometry is going to be projected. If so a second projected rectangle is drawn | 371 | // determine if the geometry is going to be projected. If so a second projected rectangle is drawn |
372 | var isProjected = ((MathUtils.fpCmp(thePlane[2],1.0) !== 0) || (MathUtils.fpSign(thePlane[3]) !== 0)); | 372 | var isProjected = ((MathUtils.fpCmp(thePlane[2],1.0) !== 0) || (MathUtils.fpSign(thePlane[3]) !== 0)); |
373 | 373 | ||
374 | // TODO - We no longer need to project drawing after perspective fix. Need to clean up this code. | ||
375 | // For now, just setting isProjected to false so rest of the drawing still works. | ||
376 | isProjected = false; | ||
374 | // get and draw the unprojected object points | 377 | // get and draw the unprojected object points |
375 | var projPtArr = []; | 378 | var projPtArr = []; |
376 | if (isProjected) | 379 | if (isProjected) |
@@ -442,7 +445,7 @@ exports.DrawingToolBase = Montage.create(Montage, { | |||
442 | flatMat = divMat; | 445 | flatMat = divMat; |
443 | flatMatSafe = MathUtils.scientificToDecimal(flatMat, 10); | 446 | flatMatSafe = MathUtils.scientificToDecimal(flatMat, 10); |
444 | 447 | ||
445 | return "perspective(" + 1400 + ") matrix3d(" + flatMatSafe + ")"; | 448 | return "matrix3d(" + flatMatSafe + ")"; |
446 | } | 449 | } |
447 | }, | 450 | }, |
448 | 451 | ||