Nayanapawar / simile-widgets

Automatically exported from code.google.com/p/simile-widgets
0 stars 1 forks source link

Band function scrollToCenter is bumpy #433

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
scrollToCenter is bumpy

(version 2.3.0)

Timeline._Band.prototype.scrollToCenter = function(date, f) {
var pixelOffset = this._ether.dateToPixelOffset(date);
    if (pixelOffset < -this._viewLength / 2) {
        this.setCenterVisibleDate(this.pixelOffsetToDate(pixelOffset + this._viewLength));
    } else if (pixelOffset > 3 * this._viewLength / 2) {
        this.setCenterVisibleDate(this.pixelOffsetToDate(pixelOffset - this._viewLength));
    }
this._autoScroll(Math.round(this._viewLength / 2 - 
this._ether.dateToPixelOffset(date)), f);
};

I don't really understand the point behind the two conditions and the 
setCenterVisible, it makes the scrollToCenter() function bumpy

Original issue reported on code.google.com by Julien.C...@gmail.com on 10 Mar 2011 at 2:33

GoogleCodeExporter commented 9 years ago

Original comment by ryan...@csail.mit.edu on 23 Jun 2011 at 10:27