diff options
author | Nivesh Rajbhandari | 2012-07-19 10:55:22 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-07-19 10:55:22 -0700 |
commit | fc13ef1e806116bb7ece5bb06604fa4f5714a6ed (patch) | |
tree | 8e8d87b31fffb7163aff0634ba4128f08be66343 /js/controllers | |
parent | 16d06bac95ce8334f8c5586750e98360dbc9cbd9 (diff) | |
download | ninja-fc13ef1e806116bb7ece5bb06604fa4f5714a6ed.tar.gz |
Squashed commit of the following:
commit 0285afe3d4bd458a51f11241f13ea6ffdb0283ed
Merge: 2f9f5e3 16d06ba
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Thu Jul 19 10:54:25 2012 -0700
Merge branch 'refs/heads/ninja-mqg734-master' into StageToolDrawingOptimizations
commit 2f9f5e369eb96f6c81b5e4bcbe09b418825e2864
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Wed Jul 18 17:15:19 2012 -0700
Fixed selection bounds not drawing in nested tags.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit b0a3507f9d27579ad511c69314a09136d7f7c6a0
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Wed Jul 18 11:07:44 2012 -0700
Layout info needs to redraw if stage is updated.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit 63c5e0bf52c33706ba597cb69f7794e287bd0f06
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Tue Jul 17 15:40:54 2012 -0700
Per feedback from QE, we are still going to draw tool feedback on each mouse move so the selection bounds are not out of sync with the elements.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit 0599a742092b985c4002977e501e3b457173f1d9
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Tue Jul 17 15:28:25 2012 -0700
Fixed grid not drawing correctly when switching documents and when adding/removing elements.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit fd9410606ee6358910d65b2cb5f71812fd44a7c4
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Tue Jul 17 11:36:09 2012 -0700
Updated drawing feedback to handle matrix 2d values entered via CSS Panel.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit 559c16c7ac8c9f40b94a011a6f932d4f97df66a7
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Mon Jul 16 17:14:28 2012 -0700
IKNinja-751 - Selection boundary doesn't follow the transform applied in the CSS Panel.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit e2da5340159db5cd6f75bf6c9b7eb9cbf959e5cd
Merge: 7cc5de3 5146f22
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Mon Jul 16 15:36:28 2012 -0700
Merge branch 'refs/heads/ninja-mqg734-master' into StageToolDrawingOptimizations
commit 7cc5de39e41b4220f53c91b15b0cf0ed53e0b0f6
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Mon Jul 16 14:52:06 2012 -0700
Check if ownerDocument.defaultValue is null.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit 5ae97995a28a4b06fb7f8703eb8090ea16d88acd
Merge: d17974d 0ede302
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Mon Jul 16 09:27:22 2012 -0700
Merge branch 'refs/heads/ninja-mqg734-master' into StageToolDrawingOptimizations
commit d17974d77273bb635311cb6466f4427cf4d9e5d4
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Mon Jul 16 08:45:05 2012 -0700
Pass in selectedElements array directly to drawUtils when drawing selection bounds instead of creating a duplicate array.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit 0b1ea3144cb3e2c1d272f60da32423d0604ace3b
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Fri Jul 13 14:03:40 2012 -0700
Fixed line tool not drawing the width and height info.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit b9c70e8d9ae324aa21fa5490edc71d8503bcefbc
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Fri Jul 13 12:42:25 2012 -0700
Used cached offsetWidth and offsetHeight.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit 9e17ac7124745ba745014efe149b31dee4fe658f
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Thu Jul 12 16:25:41 2012 -0700
Converting tabs to spaces … again!
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit 351726c951bb73c28f0e15ea1ab32e85cc735688
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Thu Jul 12 16:14:31 2012 -0700
Tabs should be 4 spaces.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit 250c419aa2dbcb10f012817ee7039aca77cb2518
Merge: 3f8d61a 2880e1d
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Thu Jul 12 16:08:31 2012 -0700
Merge branch 'refs/heads/ninja-mqg734-master' into StageToolDrawingOptimizations
commit 3f8d61a676da3992947ed9a2ed0e449780fcfbe0
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Thu Jul 12 15:53:44 2012 -0700
Rotate tool was not working immediately after switching selection and selection bounds were not drawing after resizing canvases.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit e2e1f81e3b6917e1032e1b99b79c266937f3bb25
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Thu Jul 12 12:15:59 2012 -0700
Single draw cycle for stage updates and tool drawings.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit 95a90b4c95ee3163c97bea317144366674e49ade
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Mon Jun 18 11:46:38 2012 -0700
Single draw cycle for the stage and layout.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit 21966b1515d80d2161a14e5a19bc66f3f49a92ce
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Fri Jun 15 13:33:14 2012 -0700
Cache element offsets, including offsetParent.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit 80c563c8ba06149691c6c1e754dd9a5e43bc7d4b
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Mon Jul 9 17:30:00 2012 -0700
Open materials editor popup next to PI button.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/controllers')
-rwxr-xr-x | js/controllers/styles-controller.js | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 89a389a4..b0db1b6a 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js | |||
@@ -1292,33 +1292,68 @@ var stylesController = exports.StylesController = Montage.create(Component, { | |||
1292 | 1292 | ||
1293 | ///// Get Matrix From Element | 1293 | ///// Get Matrix From Element |
1294 | ///// Returns the matrix from an element's -webkit-transform | 1294 | ///// Returns the matrix from an element's -webkit-transform |
1295 | //// TODO - This routine should eventually check for other transform styles, i.e., rotateX, translateZ, etc. | ||
1296 | 1295 | ||
1297 | getMatrixFromElement : { | 1296 | getMatrixFromElement : { |
1298 | value: function(element, isStage) { | 1297 | value: function(element, isStage) { |
1299 | isStage = false; | 1298 | isStage = false; |
1300 | var xformStr = this.getElementStyle(element, "-webkit-transform", true, isStage), | 1299 | var xformStr = this.getElementStyle(element, "-webkit-transform", true, isStage), |
1301 | mat; | 1300 | mat, |
1301 | index1, | ||
1302 | index2, | ||
1303 | substr, | ||
1304 | numArray, | ||
1305 | nNums, | ||
1306 | i; | ||
1302 | 1307 | ||
1303 | if (xformStr) { | 1308 | if (xformStr) { |
1304 | var index1 = xformStr.indexOf( "matrix3d("); | 1309 | // Check for 3d matrix |
1310 | index1 = xformStr.indexOf( "matrix3d("); | ||
1311 | // If style does not contain 'matrix3d', try computed matrix/matrix3d from rotateY, translateZ, etc. | ||
1312 | if((index1 === -1) && element.ownerDocument.defaultView) { | ||
1313 | xformStr = element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue("-webkit-transform"); | ||
1314 | index1 = xformStr.indexOf( "matrix3d("); | ||
1315 | } | ||
1305 | if (index1 >= 0) { | 1316 | if (index1 >= 0) { |
1306 | index1 += 9; // do not include 'matrix3d(' | 1317 | index1 += 9; // do not include 'matrix3d(' |
1307 | var index2 = xformStr.indexOf( ")", index1 ); | 1318 | index2 = xformStr.indexOf( ")", index1 ); |
1308 | if (index2 >= 0) { | 1319 | if (index2 >= 0) { |
1309 | var substr = xformStr.substr( index1, (index2-index1)); | 1320 | substr = xformStr.substr( index1, (index2-index1)); |
1310 | if (substr && (substr.length > 0)) { | 1321 | if (substr && (substr.length > 0)) { |
1311 | var numArray = substr.split(','); | 1322 | numArray = substr.split(','); |
1312 | var nNums = numArray.length; | 1323 | nNums = numArray.length; |
1313 | if (nNums == 16) { | 1324 | if (nNums == 16) { |
1314 | // gl-matrix wants row order | 1325 | // gl-matrix wants row order |
1315 | mat = numArray; | 1326 | mat = numArray; |
1316 | for (var i=0; i<16; i++) { | 1327 | for (i=0; i<16; i++) { |
1317 | mat[i] = Number( mat[i] ); | 1328 | mat[i] = Number( mat[i] ); |
1318 | } | 1329 | } |
1319 | } | 1330 | } |
1320 | } | 1331 | } |
1321 | } | 1332 | } |
1333 | } else { | ||
1334 | // Check for 2d matrix | ||
1335 | index1 = xformStr.indexOf( "matrix("); | ||
1336 | if (index1 >= 0) { | ||
1337 | index1 += 7; // do not include 'matrix(' | ||
1338 | index2 = xformStr.indexOf( ")", index1 ); | ||
1339 | if (index2 >= 0) { | ||
1340 | substr = xformStr.substr( index1, (index2-index1)); | ||
1341 | if (substr && (substr.length > 0)) { | ||
1342 | numArray = substr.split(','); | ||
1343 | nNums = numArray.length; | ||
1344 | if (nNums === 6) { | ||
1345 | // gl-matrix wants row order | ||
1346 | mat = Matrix.I(4); | ||
1347 | mat[0] = Number(numArray[0]); | ||
1348 | mat[1] = Number(numArray[1]); | ||
1349 | mat[4] = Number(numArray[2]); | ||
1350 | mat[5] = Number(numArray[3]); | ||
1351 | mat[12] = Number(numArray[4]); | ||
1352 | mat[13] = Number(numArray[5]); | ||
1353 | } | ||
1354 | } | ||
1355 | } | ||
1356 | } | ||
1322 | } | 1357 | } |
1323 | } | 1358 | } |
1324 | return mat; | 1359 | return mat; |