[Timeline] Provide greater initial width

This avoids starting with a scrollable width too small for the
initial scroll position that the zoom controller selects.
Fixes #817
This commit is contained in:
Victor Woeltjen 2016-06-02 14:46:50 -07:00
parent 1d6880c283
commit 026ece3956
2 changed files with 2 additions and 2 deletions

View File

@ -122,7 +122,7 @@ define(
*/ */
width: function (timestamp) { width: function (timestamp) {
var pixels = Math.ceil(toPixels(timestamp * (1 + PADDING))); var pixels = Math.ceil(toPixels(timestamp * (1 + PADDING)));
return Math.max(bounds.width, pixels); return Math.max(bounds.width * 2, pixels);
} }
}; };
} }

View File

@ -124,7 +124,7 @@ define(
var testPixel = mockScope.scroll.width / 4, var testPixel = mockScope.scroll.width / 4,
testMillis = controller.toMillis(testPixel); testMillis = controller.toMillis(testPixel);
expect(controller.width(testMillis)) expect(controller.width(testMillis))
.toEqual(mockScope.scroll.width); .not.toBeLessThan(mockScope.scroll.width);
}); });
it("provides a width with some margin past timestamp", function () { it("provides a width with some margin past timestamp", function () {