From 2cf5c882b130b00ea906cfaafc7fef2e4eeefa6c Mon Sep 17 00:00:00 2001 From: Danijel Anđelković Date: Sat, 23 Apr 2022 03:08:09 +0200 Subject: Ispravio BUG gde pri osvezavanju strane pozadina se ucita pre korisnickih podesavanja za pozadinu. Povecao max broj tacaka. --- .../reactive-background/reactive-background.component.ts | 15 +++++++++++---- frontend/src/app/app.component.html | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'frontend') diff --git a/frontend/src/app/_elements/reactive-background/reactive-background.component.ts b/frontend/src/app/_elements/reactive-background/reactive-background.component.ts index 4cafbc6d..97387ac8 100644 --- a/frontend/src/app/_elements/reactive-background/reactive-background.component.ts +++ b/frontend/src/app/_elements/reactive-background/reactive-background.component.ts @@ -145,10 +145,10 @@ export class ReactiveBackgroundComponent implements AfterViewInit { } drawPoint(p: Point) { - this.ctx!.fillStyle = this.pointColor; - this.ctx!.beginPath(); - this.ctx!.arc(p.x * this.width, p.y * this.height, p.size * this.screenDepth(p.x), 0, 2 * Math.PI); - this.ctx!.fill(); + this.ctx.fillStyle = this.pointColor; + this.ctx.beginPath(); + this.ctx.arc(p.x * this.width, p.y * this.height, p.size * this.screenDepth(p.x), 0, 2 * Math.PI); + this.ctx.fill(); } resize() { @@ -161,6 +161,13 @@ export class ReactiveBackgroundComponent implements AfterViewInit { this.canvas.height = this.height; } + if (this.cookie.check('animateBackground')) { + this.animate = this.cookie.get('animateBackground') == 'true'; + } + if (this.cookie.check('backgroundFill')) { + this.fill = parseFloat(this.cookie.get('backgroundFill')); + } + this.drawBackground(); } diff --git a/frontend/src/app/app.component.html b/frontend/src/app/app.component.html index 984389c4..aae2f75d 100644 --- a/frontend/src/app/app.component.html +++ b/frontend/src/app/app.component.html @@ -1,9 +1,9 @@ - + - + - + pozadina -- cgit v1.2.3