public int millisecondsToX ( long milliseconds ) { if ( autoScroll . get ( ) ) { int playHead = ( getWidth ( ) / 2 ) + 2 ; long offset = milliseconds - getFurthestPlaybackPosition ( ) ; return playHead + ( Util . timeToHalfFrame ( offset ) / scale . get ( ) ) ; } return Util . timeToHalfFrame ( milliseconds ) / scale . get ( ) ; }
Converts a time in milliseconds to the appropriate x coordinate for drawing something at that time .