aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJonathan Duran2012-03-08 11:04:59 -0800
committerJonathan Duran2012-03-08 11:04:59 -0800
commitb4aa9a46bdf6ed748cbb3fc2a2a4fc226e0e7fd7 (patch)
tree017ce4f53375ec7dfec3b8389a13ebba585ba603 /js
parentabdd0542bce89b6b22f0684d00b9cf24e5d0a5e6 (diff)
downloadninja-b4aa9a46bdf6ed748cbb3fc2a2a4fc226e0e7fd7.tar.gz
Remove unnecessary needsDraw calls
Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js27
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js26
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js34
3 files changed, 49 insertions, 38 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index d65d031f..e561e45d 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -82,8 +82,8 @@ var Layer = exports.Layer = Montage.create(Component, {
82 if (newVal !== this._layerName) { 82 if (newVal !== this._layerName) {
83 this._layerEditable.value = newVal; 83 this._layerEditable.value = newVal;
84 this._layerName = newVal; 84 this._layerName = newVal;
85 this._layerEditable.needsDraw = true; 85 //this._layerEditable.needsDraw = true;
86 this.needsDraw = true; 86 //this.needsDraw = true;
87 } 87 }
88 88
89 } 89 }
@@ -119,7 +119,7 @@ var Layer = exports.Layer = Montage.create(Component, {
119 set:function(value){ 119 set:function(value){
120 if (this._dtextPositionX !== value) { 120 if (this._dtextPositionX !== value) {
121 this._dtextPositionX = value; 121 this._dtextPositionX = value;
122 this.needsDraw = true; 122 //this.needsDraw = true;
123 } 123 }
124 124
125 } 125 }
@@ -138,7 +138,7 @@ var Layer = exports.Layer = Montage.create(Component, {
138 set:function(value){ 138 set:function(value){
139 if (this._dtextPositionY !== value) { 139 if (this._dtextPositionY !== value) {
140 this._dtextPositionY = value; 140 this._dtextPositionY = value;
141 this.needsDraw = true; 141 //this.needsDraw = true;
142 } 142 }
143 143
144 } 144 }
@@ -157,7 +157,7 @@ var Layer = exports.Layer = Montage.create(Component, {
157 set:function(value){ 157 set:function(value){
158 if (this._dtextScaleX !== value) { 158 if (this._dtextScaleX !== value) {
159 this._dtextScaleX = value; 159 this._dtextScaleX = value;
160 this.needsDraw = true; 160 //this.needsDraw = true;
161 } 161 }
162 162
163 } 163 }
@@ -176,7 +176,7 @@ var Layer = exports.Layer = Montage.create(Component, {
176 set:function(value){ 176 set:function(value){
177 if (this._dtextScaleY !== value) { 177 if (this._dtextScaleY !== value) {
178 this._dtextScaleY = value; 178 this._dtextScaleY = value;
179 this.needsDraw = true; 179 //this.needsDraw = true;
180 } 180 }
181 181
182 } 182 }
@@ -195,7 +195,7 @@ var Layer = exports.Layer = Montage.create(Component, {
195 set:function(value){ 195 set:function(value){
196 if (this._dtextSkewX !== value) { 196 if (this._dtextSkewX !== value) {
197 this._dtextSkewX = value; 197 this._dtextSkewX = value;
198 this.needsDraw = true; 198 //this.needsDraw = true;
199 } 199 }
200 200
201 } 201 }
@@ -214,7 +214,7 @@ var Layer = exports.Layer = Montage.create(Component, {
214 set:function(value){ 214 set:function(value){
215 if (this._dtextSkewY !== value) { 215 if (this._dtextSkewY !== value) {
216 this._dtextSkewY = value; 216 this._dtextSkewY = value;
217 this.needsDraw = true; 217 //this.needsDraw = true;
218 } 218 }
219 219
220 } 220 }
@@ -233,7 +233,7 @@ var Layer = exports.Layer = Montage.create(Component, {
233 set:function(value){ 233 set:function(value){
234 if (this._dtextRotate !== value) { 234 if (this._dtextRotate !== value) {
235 this._dtextRotate = value; 235 this._dtextRotate = value;
236 this.needsDraw = true; 236 //this.needsDraw = true;
237 } 237 }
238 238
239 } 239 }
@@ -259,7 +259,7 @@ var Layer = exports.Layer = Montage.create(Component, {
259 this.selectStyle(false); 259 this.selectStyle(false);
260 } 260 }
261 this._isSelected = value; 261 this._isSelected = value;
262 this.needsDraw = true; 262 //this.needsDraw = true;
263 } 263 }
264 264
265 } 265 }
@@ -332,7 +332,7 @@ var Layer = exports.Layer = Montage.create(Component, {
332 set: function(newVal) { 332 set: function(newVal) {
333 if (newVal !== this._isTransformCollapsed) { 333 if (newVal !== this._isTransformCollapsed) {
334 this._isTransformCollapsed = newVal; 334 this._isTransformCollapsed = newVal;
335 this.needsDraw = true; 335 //this.needsDraw = true;
336 } 336 }
337 } 337 }
338 }, 338 },
@@ -349,7 +349,7 @@ var Layer = exports.Layer = Montage.create(Component, {
349 set: function(newVal) { 349 set: function(newVal) {
350 if (newVal !== this._isPositionCollapsed) { 350 if (newVal !== this._isPositionCollapsed) {
351 this._isPositionCollapsed = newVal; 351 this._isPositionCollapsed = newVal;
352 this.needsDraw = true; 352 //this.needsDraw = true;
353 } 353 }
354 } 354 }
355 }, 355 },
@@ -366,7 +366,7 @@ var Layer = exports.Layer = Montage.create(Component, {
366 set: function(newVal) { 366 set: function(newVal) {
367 if (newVal !== this._isStyleCollapsed) { 367 if (newVal !== this._isStyleCollapsed) {
368 this._isStyleCollapsed = newVal; 368 this._isStyleCollapsed = newVal;
369 this.needsDraw = true; 369 //this.needsDraw = true;
370 } 370 }
371 } 371 }
372 }, 372 },
@@ -422,6 +422,7 @@ var Layer = exports.Layer = Montage.create(Component, {
422 this.dtextScaleX = this.layerData.dtextScaleX; 422 this.dtextScaleX = this.layerData.dtextScaleX;
423 this.dtextScaleY = this.layerData.dtextScaleY; 423 this.dtextScaleY = this.layerData.dtextScaleY;
424 this.dtextRotate = this.layerData.dtextRotate; 424 this.dtextRotate = this.layerData.dtextRotate;
425 this.needsDraw = true;
425 } 426 }
426 }, 427 },
427 428
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index b12183f2..0185d448 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -276,6 +276,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
276 this.layout_tracks.addEventListener("scroll", this.updateLayerScroll.bind(this), false); 276 this.layout_tracks.addEventListener("scroll", this.updateLayerScroll.bind(this), false);
277 this.user_layers.addEventListener("scroll", this.updateLayerScroll.bind(this), false); 277 this.user_layers.addEventListener("scroll", this.updateLayerScroll.bind(this), false);
278 this.end_hottext.addEventListener("changing", this.updateTrackContainerWidth.bind(this), false); 278 this.end_hottext.addEventListener("changing", this.updateTrackContainerWidth.bind(this), false);
279 this.playhead.addEventListener("mousedown", this.startPlayheadTracking.bind(this), false);
280 this.playhead.addEventListener("mouseup", this.stopPlayheadTracking.bind(this), false);
281 this.time_markers.addEventListener("click", this.updatePlayhead.bind(this), false);
279 } 282 }
280 }, 283 },
281 284
@@ -410,6 +413,29 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
410 } 413 }
411 }, 414 },
412 415
416 startPlayheadTracking:{
417 value:function(){
418 this.time_markers.onmousemove = this.updatePlayhead.bind(this);
419 }
420 },
421
422 stopPlayheadTracking:{
423 value:function () {
424 this.time_markers.onmousemove = null;
425 }
426 },
427
428 updatePlayhead:{
429 value:function (event) {
430 var clickedPosition = event.target.offsetLeft + event.offsetX;
431 this.playhead.style.left = (clickedPosition - 2) + "px";
432 this.playheadmarker.style.left = clickedPosition + "px";
433 var currentMillisecPerPixel = Math.floor(this.millisecondsOffset / 80);
434 var currentMillisec = currentMillisecPerPixel * clickedPosition;
435 this.updateTimeText(currentMillisec);
436 }
437 },
438
413 handleSelectionChange:{ 439 handleSelectionChange:{
414 value:function(){ 440 value:function(){
415 var key , switchSelectedLayer,layerIndex; 441 var key , switchSelectedLayer,layerIndex;
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 17e50789..18df20c2 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -27,7 +27,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
27 }, 27 },
28 set:function (value) { 28 set:function (value) {
29 this._trackID = value; 29 this._trackID = value;
30 this.needsDraw = true; 30 //this.needsDraw = true;
31 } 31 }
32 }, 32 },
33 33
@@ -114,7 +114,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
114 }, 114 },
115 set: function(newVal) { 115 set: function(newVal) {
116 this._arrStyleTracks = newVal; 116 this._arrStyleTracks = newVal;
117 this.needsDraw = true; 117 //this.needsDraw = true;