diff options
author | Jonathan Duran | 2012-04-10 08:13:00 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-04-10 08:13:00 -0700 |
commit | 58e049b68e03abbacde93206d2666361022c0858 (patch) | |
tree | f1ce6b8a378674d4abcac68acd0bcca93b838a39 /js/tools/TagTool.js | |
parent | a9050f96d814469f420bcf3630d16d576b62258e (diff) | |
parent | bd43ce383b050d03b0f92cc923c517febc66ca28 (diff) | |
download | ninja-58e049b68e03abbacde93206d2666361022c0858.tar.gz |
Merge branch 'refs/heads/NINJAmaster' into TimelineUber
Diffstat (limited to 'js/tools/TagTool.js')
-rwxr-xr-x | js/tools/TagTool.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/js/tools/TagTool.js b/js/tools/TagTool.js index 5512165e..752500e0 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") { |