diff options
author | hwc487 | 2012-04-13 11:52:13 -0700 |
---|---|---|
committer | hwc487 | 2012-04-13 11:52:13 -0700 |
commit | 4f2fb5764703cab4ce3ada719b1395ed1e2f3b7c (patch) | |
tree | 3dc2e3c5a041179eed38eab1a00f851554e50005 /js/tools/TagTool.js | |
parent | 521df0ed9242efff45715998837068c87aca7efd (diff) | |
parent | 4b900ea5cd6bb77eb30cec8c03b9ec9fa662c1e9 (diff) | |
download | ninja-4f2fb5764703cab4ce3ada719b1395ed1e2f3b7c.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Snapping_II
Conflicts:
js/helper-classes/3D/view-utils.js
js/panels/presets/animations-presets.reel/animations-presets.js
js/panels/presets/style-presets.reel/style-presets.js
js/panels/presets/transitions-presets.reel/transitions-presets.js
js/tools/Translate3DToolBase.js
Diffstat (limited to 'js/tools/TagTool.js')
-rwxr-xr-x | js/tools/TagTool.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/js/tools/TagTool.js b/js/tools/TagTool.js index 5512165e..d946db72 100755 --- a/js/tools/TagTool.js +++ b/js/tools/TagTool.js | |||
@@ -221,22 +221,23 @@ exports.TagTool = Montage.create(DrawingTool, { | |||
221 | }, | 221 | }, |
222 | 222 | ||
223 | makeElement: { | 223 | makeElement: { |
224 | value: function(w, h, planeMat, midPt,tag) { | 224 | value: function(w, h, planeMat, midPt, tag, isShape) { |
225 | var styles; | ||
226 | |||
227 | var left = Math.round(midPt[0] - 0.5 * w); | 225 | var left = Math.round(midPt[0] - 0.5 * w); |
228 | var top = Math.round(midPt[1] - 0.5 * h); | 226 | var top = Math.round(midPt[1] - 0.5 * h); |
229 | 227 | ||
230 | var matStr = DrawingToolBase.getElementMatrix(planeMat, midPt); | 228 | var styles = { |
231 | |||
232 | styles = { | ||
233 | 'position': 'absolute', | 229 | 'position': 'absolute', |
234 | 'top' : top + 'px', | 230 | 'top' : top + 'px', |
235 | 'left' : left + 'px', | 231 | 'left' : left + 'px' |
236 | '-webkit-transform-style' : 'preserve-3d', | ||
237 | '-webkit-transform' : matStr | ||
238 | }; | 232 | }; |
239 | 233 | ||
234 | if(!MathUtils.isIdentityMatrix(planeMat)) { | ||
235 | styles['-webkit-transform-style'] = 'preserve-3d'; | ||
236 | styles['-webkit-transform'] = DrawingToolBase.getElementMatrix(planeMat, midPt); | ||
237 | } else if(isShape) { | ||
238 | styles['-webkit-transform-style'] = 'preserve-3d'; | ||
239 | } | ||
240 | |||
240 | // TODO - for canvas, set both as style and attribute. | 241 | // TODO - for canvas, set both as style and attribute. |
241 | // Otherwise, we need to create a separate controller for canvas elements | 242 | // Otherwise, we need to create a separate controller for canvas elements |
242 | if(tag.tagName === "CANVAS") { | 243 | if(tag.tagName === "CANVAS") { |
@@ -255,7 +256,7 @@ exports.TagTool = Montage.create(DrawingTool, { | |||
255 | value: function(tag) { | 256 | value: function(tag) { |
256 | var styles = { | 257 | var styles = { |
257 | "-webkit-transform-style": "preserve-3d", | 258 | "-webkit-transform-style": "preserve-3d", |
258 | "-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)" |
259 | }; | 260 | }; |
260 | tag.innerHTML = "content"; | 261 | tag.innerHTML = "content"; |
261 | 262 | ||