@@ -120,7 +120,7 @@ App.directive("tlBody", function () {
120
120
if ( e . which === 2 ) { // middle button
121
121
e . preventDefault ( ) ;
122
122
is_scrolling = true ;
123
- starting_scrollbar = { x : $ ( ' #scrolling_tracks' ) . scrollLeft ( ) , y : $ ( ' #scrolling_tracks' ) . scrollTop ( ) } ;
123
+ starting_scrollbar = { x : $ ( " #scrolling_tracks" ) . scrollLeft ( ) , y : $ ( " #scrolling_tracks" ) . scrollTop ( ) } ;
124
124
starting_mouse_position = { x : e . pageX , y : e . pageY } ;
125
125
element . addClass ( "drag_cursor" ) ;
126
126
}
@@ -197,11 +197,11 @@ App.directive("tlRuler", function ($timeout) {
197
197
ruler = $ ( '#ruler' ) ;
198
198
$ ( "#ruler span" ) . remove ( ) ;
199
199
200
- startPos = scope . scrollLeft ;
201
- endPos = scope . scrollLeft + $ ( "body" ) . width ( ) ;
202
- fpt = framesPerTick ( scope . pixelsPerSecond , scope . project . fps . num , scope . project . fps . den ) ;
203
- fps = scope . project . fps . num / scope . project . fps . den ;
204
- time = [ startPos / scope . pixelsPerSecond , endPos / scope . pixelsPerSecond ] ;
200
+ let startPos = scope . scrollLeft ;
201
+ let endPos = scope . scrollLeft + $ ( "body" ) . width ( ) ;
202
+ let fpt = framesPerTick ( scope . pixelsPerSecond , scope . project . fps . num , scope . project . fps . den ) ;
203
+ let fps = scope . project . fps . num / scope . project . fps . den ;
204
+ let time = [ startPos / scope . pixelsPerSecond , endPos / scope . pixelsPerSecond ] ;
205
205
206
206
if ( fpt > fps ) {
207
207
// Make sure seconds don't change when scrolling right and left
@@ -212,38 +212,38 @@ App.directive("tlRuler", function ($timeout) {
212
212
}
213
213
time [ 1 ] -= time [ 1 ] % 1 - 1 ;
214
214
215
- startFrame = time [ 0 ] * Math . round ( fps ) ;
216
- endFrame = time [ 1 ] * Math . round ( fps ) ;
215
+ let startFrame = time [ 0 ] * Math . round ( fps ) ;
216
+ let endFrame = time [ 1 ] * Math . round ( fps ) ;
217
217
218
- frame = startFrame ;
218
+ let frame = startFrame ;
219
219
while ( frame <= endFrame ) {
220
- t = frame / fps ;
221
- pos = t * scope . pixelsPerSecond ;
222
- tickSpan = $ ( '<span style="left:' + pos + 'px;"></span>' ) ;
220
+ let t = frame / fps ;
221
+ let pos = t * scope . pixelsPerSecond ;
222
+ let tickSpan = $ ( '<span style="left:' + pos + 'px;"></span>' ) ;
223
223
tickSpan . addClass ( "tick_mark" ) ;
224
224
225
225
if ( ( frame ) % ( fpt * 2 ) == 0 ) {
226
226
// Alternating long marks with times marked
227
- timeSpan = $ ( '<span style="left:' + pos + 'px;"></span>' ) ;
227
+ let timeSpan = $ ( '<span style="left:' + pos + 'px;"></span>' ) ;
228
228
timeSpan . addClass ( "ruler_time" ) ;
229
- timeText = secondsToTime ( t , scope . project . fps . num , scope . project . fps . den ) ;
229
+ let timeText = secondsToTime ( t , scope . project . fps . num , scope . project . fps . den ) ;
230
230
timeSpan [ 0 ] . innerText = timeText [ 'hour' ] + ':' +
231
231
timeText [ 'min' ] + ':' +
232
232
timeText [ 'sec' ] ;
233
233
if ( fpt < Math . round ( fps ) ) {
234
234
timeSpan [ 0 ] . innerText += ',' + timeText [ 'frame' ] ;
235
235
}
236
236
tickSpan [ 0 ] . style [ 'height' ] = '20px' ;
237
+ ruler . append ( timeSpan ) ;
237
238
}
238
- ruler . append ( timeSpan ) ;
239
239
ruler . append ( tickSpan ) ;
240
240
241
241
frame += fpt ;
242
242
}
243
243
return ;
244
244
} ;
245
245
246
- scope . $watch ( "project.scale + project.duration + scrollLeft" , function ( val ) {
246
+ scope . $watch ( "project.scale + project.duration + scrollLeft + element.width() " , function ( val ) {
247
247
if ( val ) {
248
248
$timeout ( function ( ) {
249
249
drawTimes ( ) ;
0 commit comments