[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

@@ -128,7 +128,7 @@
<div style="overflow: hidden; position: absolute; left: 0; top: 0; right: 0; height: 30px;" mct-scroll-x="scroll.x">
<mct-include key="'timeline-ticks'"
parameters="{
fullWidth: zoomController.toPixels(zoomController.duration()),
fullWidth: timelineController.width(zoomController),
start: scroll.x,
width: scroll.width,
step: zoomController.toPixels(zoomController.zoom()),

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;
}