Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line Width as Input #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export class AiaImageAnnotatorComponent implements OnInit, OnChanges {

@Input() displayWidth = null;

@Input() strokeSize: number;

@ViewChild('imageCanvas') private imageCanvasRef: ElementRef;
@ViewChild('drawingCanvas') private drawingCanvasRef: ElementRef;
@ViewChild('mergeCanvas') private mergeCanvasRef: ElementRef;
Expand Down Expand Up @@ -209,7 +211,6 @@ export class AiaImageAnnotatorComponent implements OnInit, OnChanges {
this.drawingCtx = this.drawingCanvasRef.nativeElement.getContext('2d');
this.drawingCtx.lineJoin = 'round';
this.drawingCtx.lineCap = 'round';
this.drawingCtx.lineWidth = 2;

this.drawingCtx.textBaseline = 'hanging';

Expand All @@ -226,6 +227,7 @@ export class AiaImageAnnotatorComponent implements OnInit, OnChanges {

this.drawingCtx.strokeStyle = color || DEFAULTS.color;
this.drawingCtx.fillStyle = color || DEFAULTS.color;
this.drawingCtx.lineWidth = this.strokeSize || DEFAULTS.strokeSize;
this.textEntry.setColor(color || DEFAULTS.color);

const fontString = `${fontSize || DEFAULTS.fontSize} ${fontFamily || DEFAULTS.fontFamily}`;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export const DEFAULTS = {
fontSize: '15px',
fontFamily: 'Georgia',
color: '#1218CE'
color: '#1218CE',
strokeSize:20
};