added margin as parameter

This commit is contained in:
libretech committed 2018-05-13 03:34:25 +02:00
1 parent d08f9e4c7c
commit b493fa0ed7
4 files changed
+17 -5

No files matched your search

+4 -2
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
},