Merge pull request #7603 from opf/fix/30802/timeline-zoom

[30802] add left/right margin of timeline viewport into account for zoom

[ci skip]
pull/7609/head
Oliver Günther 5 years ago committed by GitHub
commit 977e309640
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      frontend/src/app/components/wp-table/timeline/container/wp-timeline-container.directive.ts

@ -300,7 +300,6 @@ export class WorkPackageTimelineTableController implements AfterViewInit, OnDest
const nonVisibleDaysLeft = Math.floor(scrollLeft / this.viewParameters.pixelPerDay);
return this.viewParameters.dateDisplayStart.clone().add(nonVisibleDaysLeft, 'days');
}
getLastDayInViewport() {
const outerContainer = this.getParentScrollContainer();
const scrollLeft = outerContainer.scrollLeft;
@ -401,7 +400,7 @@ export class WorkPackageTimelineTableController implements AfterViewInit, OnDest
});
// left spacing
newParams.dateDisplayStart.subtract(currentParams.dayCountForMarginLeft, 'days');
newParams.dateDisplayStart = newParams.dateDisplayStart.subtract(currentParams.dayCountForMarginLeft, 'days');
// right spacing
// RR: kept both variants for documentation purpose.
@ -412,7 +411,7 @@ export class WorkPackageTimelineTableController implements AfterViewInit, OnDest
const pixelPerDay = currentParams.pixelPerDay;
const visibleDays = Math.ceil((width / pixelPerDay) * 1.5);
newParams.dateDisplayEnd.add(visibleDays, 'days');
newParams.dateDisplayEnd = newParams.dateDisplayEnd.add(visibleDays, 'days');
// Check if view params changed:

Loading…
Cancel
Save