Skip to content

Commit

Permalink
fix: fix print error
Browse files Browse the repository at this point in the history
  • Loading branch information
HandsomeButterball committed Aug 20, 2020
1 parent fe0e677 commit f773f28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/gantt/src/components/links/links.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<svg [attr.width]="ganttUpper.view.width" height="100%">
<svg [attr.width]="ganttUpper.view.width" class="gantt-links-overlay-main" height="100%">
<ng-container *ngFor="let link of links; let i = index; trackBy: trackBy">
<path [attr.d]="link.path" fill="transparent" stroke-width="2" [attr.stroke]="link.color" pointer-events="none"></path>
<g>
Expand Down
6 changes: 6 additions & 0 deletions packages/gantt/src/gantt-print.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,20 @@ export class GanttPrintService {
const ganttClass = root.className;
const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`) as HTMLElement;
const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-overlay-main') as HTMLElement;
const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main') as HTMLElement;

// change targetDom width
cloneGanttDom.style.width = `${printWidth}px`;
cloneGanttDom.style.height = `${printHeight}px`;
cloneGanttDom.style.overflow = `unset`;
cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
cloneCalendarOverlay.style.height = `${printHeight}px`;
cloneCalendarOverlay.style.background = 'transparent';

if (cloneLinksOverlay) {
cloneLinksOverlay.style.height = `${printHeight}px`;
}

// setInlineStyles for svg
this.setInlineStyles(cloneGanttDom);
}
Expand Down

0 comments on commit f773f28

Please sign in to comment.