From ea967e87293a4f751b3bbb07b7ddad05fdf96b2f Mon Sep 17 00:00:00 2001 From: ZEF Devel Date: Sun, 2 Aug 2020 12:30:44 +0300 Subject: [PATCH] Reverted previous bug fix since it caused new bugs --- projects/lib/src/lib/color-picker.component.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/lib/src/lib/color-picker.component.ts b/projects/lib/src/lib/color-picker.component.ts index 86465fc..1e22c7d 100644 --- a/projects/lib/src/lib/color-picker.component.ts +++ b/projects/lib/src/lib/color-picker.component.ts @@ -138,6 +138,11 @@ export class ColorPickerComponent implements OnInit, OnDestroy, AfterViewInit { ngOnInit(): void { this.slider = new SliderPosition(0, 0, 0, 0); + const hueWidth = this.hueSlider.nativeElement.offsetWidth || 140; + const alphaWidth = this.alphaSlider.nativeElement.offsetWidth || 140; + + this.sliderDimMax = new SliderDimension(hueWidth, this.cpWidth, 130, alphaWidth); + if (this.cpCmykEnabled) { this.format = ColorFormats.CMYK; } else if (this.cpOutputFormat === 'rgba') { @@ -159,11 +164,6 @@ export class ColorPickerComponent implements OnInit, OnDestroy, AfterViewInit { } ngAfterViewInit(): void { - const hueWidth = this.hueSlider.nativeElement.offsetWidth || 140; - const alphaWidth = this.alphaSlider.nativeElement.offsetWidth || 140; - - this.sliderDimMax = new SliderDimension(hueWidth, this.cpWidth, 130, alphaWidth); - if (this.cpWidth !== 230 || this.cpDialogDisplay === 'inline') { const hueWidth = this.hueSlider.nativeElement.offsetWidth || 140; const alphaWidth = this.alphaSlider.nativeElement.offsetWidth || 140;