[Timeline] Account for tick size

Account for tick size in duration reported by TimelineZoomController,
to avoid tick marks being cut off prematurely due to changes for
#936
This commit is contained in:
Victor Woeltjen
2016-05-24 13:02:30 -07:00
parent 3795570938
commit 00534f8af7
2 changed files with 3 additions and 2 deletions

View File

@@ -38,7 +38,8 @@ define(
// Round a duration to a larger value, to ensure space for editing
function roundDuration(value) {
// Ensure there's always an extra day or so
var sz = zoomLevels[zoomLevels.length - 1];
var tickCount = bounds.width / tickWidth,
sz = zoomLevels[zoomLevels.length - 1] * tickCount;
value *= 1.25; // Add 25% padding to start
return Math.ceil(value / sz) * sz;
}