diff options
-rwxr-xr-x | js/helper-classes/3D/math-utils.js | 33 | ||||
-rwxr-xr-x | js/helper-classes/3D/snap-manager.js | 32 | ||||
-rw-r--r-- | js/panels/Timeline/Collapser.js | 5 | ||||
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.html | 14 | ||||
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 22 | ||||
-rw-r--r-- | js/panels/Timeline/Layer.reel/css/Layer.css | 73 | ||||
-rw-r--r-- | js/panels/Timeline/Layer.reel/scss/Layer.scss | 2 | ||||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html | 5 | ||||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 250 | ||||
-rw-r--r-- | js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 82 | ||||
-rwxr-xr-x | js/tools/LineTool.js | 9 | ||||
-rwxr-xr-x | js/tools/OvalTool.js | 20 | ||||
-rwxr-xr-x | js/tools/RectTool.js | 19 | ||||
-rwxr-xr-x | js/tools/SelectionTool.js | 282 | ||||
-rwxr-xr-x | js/tools/TranslateObject3DTool.js | 7 | ||||
-rwxr-xr-x | js/tools/modifier-tool-base.js | 7 |
16 files changed, 602 insertions, 260 deletions
diff --git a/js/helper-classes/3D/math-utils.js b/js/helper-classes/3D/math-utils.js index 37044763..de63f880 100755 --- a/js/helper-classes/3D/math-utils.js +++ b/js/helper-classes/3D/math-utils.js | |||
@@ -538,6 +538,39 @@ var MathUtilsClass = exports.MathUtilsClass = Object.create(Object.prototype, { | |||
538 | } | 538 | } |
539 | }, | 539 | }, |
540 | 540 | ||
541 | isIdentityMatrix: { | ||
542 | value: function( mat ) | ||
543 | { | ||
544 | if(!mat) | ||
545 | { | ||
546 | return false; | ||
547 | } | ||
548 | else | ||
549 | { | ||
550 | if(mat[0] !== 1) return false; | ||
551 | if(mat[1] !== 0) return false; | ||
552 | if(mat[2] !== 0) return false; | ||
553 | if(mat[3] !== 0) return false; | ||
554 | |||
555 | if(mat[4] !== 0) return false; | ||
556 | if(mat[5] !== 1) return false; | ||
557 | if(mat[6] !== 0) return false; | ||
558 | if(mat[7] !== 0) return false; | ||
559 | |||
560 | if(mat[8] !== 0) return false; | ||
561 | if(mat[9] !== 0) return false; | ||
562 | if(mat[10] !== 1) return false; | ||
563 | if(mat[11] !== 0) return false; | ||
564 | |||
565 | if(mat[12] !== 0) return false; | ||
566 | if(mat[13] !== 0) return false; | ||
567 | if(mat[14] !== 0) return false; | ||
568 | if(mat[15] !== 1) return false; | ||
569 | } | ||
570 | return true; | ||
571 | } | ||
572 | }, | ||
573 | |||
541 | rectsOverlap: | 574 | rectsOverlap: |
542 | { | 575 | { |
543 | value: function( pt, width, height, elt ) | 576 | value: function( pt, width, height, elt ) |
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 372be345..596ba56a 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js | |||
@@ -40,6 +40,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { | |||
40 | 40 | ||
41 | // keep a reference to the most recent hitRecord. Used for drawing feedback on the stage | 41 | // keep a reference to the most recent hitRecord. Used for drawing feedback on the stage |
42 | _lastHit : { value: null, writable: true }, | 42 | _lastHit : { value: null, writable: true }, |
43 | _hitRecords : { value: [], writable: true }, | ||
43 | 44 | ||
44 | // keep a list of objects to avoid snapping to | 45 | // keep a list of objects to avoid snapping to |
45 | _avoidList : { value: [], writable: true }, | 46 | _avoidList : { value: [], writable: true }, |
@@ -274,6 +275,11 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { | |||
274 | } //if (hitRecArray.length == 0) | 275 | } //if (hitRecArray.length == 0) |
275 | 276 | ||
276 | var rtnHit; | 277 | var rtnHit; |
278 | |||
279 | // Save reference to hit records to verify last hit record's element matches browser's elementFromPoint | ||
280 | this._hitRecords.length = 0; | ||
281 | this._hitRecords = hitRecArray; | ||
282 | |||
277 | if (hitRecArray.length > 0) | 283 | if (hitRecArray.length > 0) |
278 | { | 284 | { |
279 | this.sortHitRecords( hitRecArray ); | 285 | this.sortHitRecords( hitRecArray ); |
@@ -2246,6 +2252,30 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { | |||
2246 | drawUtils.setDrawingSurfaceElement(saveContext); | 2252 | drawUtils.setDrawingSurfaceElement(saveContext); |
2247 | } | 2253 | } |
2248 | } | 2254 | } |
2249 | } | 2255 | }, |
2256 | |||
2257 | findHitRecordForElement: { | ||
2258 | value: function(elt) { | ||
2259 | var rtnHit; | ||
2260 | |||
2261 | if (!this._hitRecords) return; | ||
2262 | var nHits = this._hitRecords.length; | ||
2263 | |||
2264 | for (var i=0; i<nHits; i++) | ||
2265 | { | ||
2266 | var hi = this._hitRecords[i]; | ||
2267 | if(hi.getElement() === elt) | ||
2268 | { | ||
2269 | rtnHit = hi; | ||
2270 | break; | ||
2271 | } | ||
2272 | } | ||
2273 | // catch-all to turn off drag plane snapping | ||
2274 | this.deactivateDragPlane(); | ||
2275 | |||
2276 | this.setLastHit( rtnHit ); | ||
2277 | return rtnHit; | ||
2278 | } | ||
2279 | } | ||
2250 | 2280 | ||
2251 | }); | 2281 | }); |
diff --git a/js/panels/Timeline/Collapser.js b/js/panels/Timeline/Collapser.js index 5de884a9..ad490c2e 100644 --- a/js/panels/Timeline/Collapser.js +++ b/js/panels/Timeline/Collapser.js | |||
@@ -184,6 +184,10 @@ var Montage = require("montage/core/core").Montage, | |||
184 | // Get the original value of the overflow property: | 184 | // Get the original value of the overflow property: |
185 | this._origOverflowValue = window.getComputedStyle(this.myContent, null).getPropertyValue("overflow"); | 185 | this._origOverflowValue = window.getComputedStyle(this.myContent, null).getPropertyValue("overflow"); |
186 | 186 | ||
187 | /* | ||
188 | * Removed because of expense. This disables the feature of having the | ||
189 | * component dynamically expand/collapse the content on init based on properties; | ||
190 | * Now default state of component must be set in CSS. | ||
187 | // If the content area is supposed to start out collapsed: | 191 | // If the content area is supposed to start out collapsed: |
188 | if (this.isCollapsed) { | 192 | if (this.isCollapsed) { |
189 | this.myContent.style.height = "0px"; | 193 | this.myContent.style.height = "0px"; |
@@ -198,6 +202,7 @@ var Montage = require("montage/core/core").Montage, | |||
198 | this.myContent.classList.remove(this.collapsedClass); | 202 | this.myContent.classList.remove(this.collapsedClass); |
199 | this.clicker.classList.remove(this.collapsedClass); | 203 | this.clicker.classList.remove(this.collapsedClass); |
200 | } | 204 | } |
205 | */ | ||
201 | } | 206 | } |
202 | }, | 207 | }, |
203 | draw: { | 208 | draw: { |
diff --git a/js/panels/Timeline/Layer.reel/Layer.html b/js/panels/Timeline/Layer.reel/Layer.html index 0bd448f7..14315f8d 100644 --- a/js/panels/Timeline/Layer.reel/Layer.html +++ b/js/panels/Timeline/Layer.reel/Layer.html | |||
@@ -226,6 +226,8 @@ | |||
226 | } | 226 | } |
227 | } | 227 | } |
228 | } | 228 | } |
229 | |||
230 | |||
229 | } | 231 | } |
230 | </script> | 232 | </script> |
231 | </head> | 233 | </head> |
@@ -241,9 +243,9 @@ | |||
241 | <div class="collapsible-content content-layer collapsible-collapsed"> | 243 | <div class="collapsible-content content-layer collapsible-collapsed"> |
242 | <div class="label-position"> | 244 | <div class="label-position"> |
243 | <span class="collapsible-label">Position</span> | 245 | <span class="collapsible-label">Position</span> |
244 | <span class="collapsible-clicker clicker-position"></span> | 246 | <span class="collapsible-clicker clicker-position collapsible-collapsed"></span> |
245 | </div> | 247 | </div> |
246 | <div class="content-position collapsible-content"> | 248 | <div class="content-position collapsible-content collapsible-collapsed"> |
247 | <div class="layout-table"> | 249 | <div class="layout-table"> |
248 | <div class="layout-row"> | 250 | <div class="layout-row"> |
249 | <div class="layout-cell">X</div> | 251 | <div class="layout-cell">X</div> |
@@ -257,9 +259,9 @@ | |||
257 | </div> | 259 | </div> |
258 | <div class="label-transform"> | 260 | <div class="label-transform"> |
259 | <span class="collapsible-label">Transform</span> | 261 | <span class="collapsible-label">Transform</span> |
260 | <span class="clicker-transform collapsible-clicker"></span> | 262 | <span class="clicker-transform collapsible-clicker collapsible-collapsed"></span> |
261 | </div> | 263 | </div> |
262 | <div class="content-transform collapsible-content"> | 264 | <div class="content-transform collapsible-content collapsible-collapsed"> |
263 | <div class="layout-table"> | 265 | <div class="layout-table"> |
264 | <div class="layout-row"> | 266 | <div class="layout-row"> |
265 | <div class="layout-cell">Scale X</div> | 267 | <div class="layout-cell">Scale X</div> |
@@ -286,11 +288,11 @@ | |||
286 | </div> | 288 | </div> |
287 | <div class="label-style"> | 289 | <div class="label-style"> |
288 | <span class="collapsible-label">Style</span> | 290 | <span class="collapsible-label">Style</span> |
289 | <span class="clicker-style collapsible-clicker"></span> | 291 | <span class="clicker-style collapsible-clicker collapsible-collapsed"></span> |
290 | <div class="cssbutton button-delete disabled"></div> | 292 | <div class="cssbutton button-delete disabled"></div> |
291 | <div class="cssbutton button-add"></div> | 293 | <div class="cssbutton button-add"></div> |
292 | </div> | 294 | </div> |
293 | <div class="content-style collapsible-content"> | 295 | <div class="content-style collapsible-content collapsible-collapsed"> |
294 | <div class="" id="style-container"> | 296 | <div class="" id="style-container"> |
295 | <div class="style-row" id="layer-style"> | 297 | <div class="style-row" id="layer-style"> |
296 | </div> | 298 | </div> |
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index e3897bbf..e76b8cc0 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js | |||
@@ -403,7 +403,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
403 | this.mainCollapser.myContent = this.myContent; | 403 | this.mainCollapser.myConten |