2
0

added margin as parameter

This commit is contained in:
2018-05-13 03:34:25 +02:00
parent d08f9e4c7c
commit b493fa0ed7
4 changed files with 17 additions and 5 deletions

View File

@@ -163,16 +163,18 @@ export class CanvasDirective implements OnInit, OnChanges {
}
private updateConfig(): void {
const margin = this.canvas.clientWidth * this.param.margin;
this.config = {
width: this.canvas.clientWidth,
height: this.canvas.clientHeight,
start: {
x: this.canvas.clientWidth,
x: this.canvas.clientWidth - margin,
y: 0,
color: this.param.colors.start
},
end: {
x: 0,
x: 0 + margin,
y: this.canvas.clientHeight,
color: this.param.colors.end
},