Skip to content

Commit

Permalink
fix(print): subtitle newline image format fix (#809)
Browse files Browse the repository at this point in the history
* fix(print): subtitle newline image format fix

* Update print.service.ts

Co-authored-by: Marc-André Barbeau <[email protected]>
  • Loading branch information
alexisboyergauthier-msp and mbarbeau authored Feb 15, 2021
1 parent 483a7f4 commit 5a9fe42
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/geo/src/lib/print/shared/print.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,8 @@ export class PrintService {
const commentWidth = newContext.measureText(comment).width;
// Add height for title if defined
height = title !== '' ? height + 30 : height;
// Add height for title if defined
height = subtitle !== '' ? height + 30 : height;
// Add height for projection or scale (same line) if defined
height = projection !== false || scale !== false ? height + 30 : height;
const positionHProjScale = height - 10;
Expand Down Expand Up @@ -592,9 +594,9 @@ export class PrintService {
// Set font for subtitle
// Adjust according to title length
newContext.font = '26px Calibri';
positionHCanvas = 30;
positionHCanvas = 60;
newContext.textAlign = 'center';
newContext.fillText(subtitle, width / 2, 20, width * 0.9);
newContext.fillText(subtitle, width / 2, 50, width * 0.9);
}
// Set font for next section
newContext.font = '20px Calibri';
Expand Down

0 comments on commit 5a9fe42

Please sign in to comment.