diff options
author | Nivesh Rajbhandari | 2012-03-21 17:13:56 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-03-21 17:13:56 -0700 |
commit | 3987b73569e58843f2a91c0c6c4e4132f51ac247 (patch) | |
tree | c5e121861209f4067bf5c363e3a40e5bd515d0b4 /js/tools/TagTool.js | |
parent | 52fac825174d16e3ff6875fc497d3f3cfaf4812c (diff) | |
download | ninja-3987b73569e58843f2a91c0c6c4e4132f51ac247.tar.gz |
Do not set webkit-transform styles on elements unless 3d is used on them.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/tools/TagTool.js')
-rwxr-xr-x | js/tools/TagTool.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/js/tools/TagTool.js b/js/tools/TagTool.js index e3f49bbe..6df49a7b 100755 --- a/js/tools/TagTool.js +++ b/js/tools/TagTool.js | |||
@@ -222,21 +222,20 @@ exports.TagTool = Montage.create(DrawingTool, { | |||
222 | 222 | ||
223 | makeElement: { | 223 | makeElement: { |
224 | value: function(w, h, planeMat, midPt,tag) { | 224 | value: function(w, h, planeMat, midPt,tag) { |
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 | } | ||
238 | |||
240 | // TODO - for canvas, set both as style and attribute. | 239 | // TODO - for canvas, set both as style and attribute. |
241 | // Otherwise, we need to create a separate controller for canvas elements | 240 | // Otherwise, we need to create a separate controller for canvas elements |
242 | if(tag.tagName === "CANVAS") { | 241 | if(tag.tagName === "CANVAS") { |