Skip to content

Commit

Permalink
Reverted previous bug fix since it caused new bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
zefdevel committed Aug 2, 2020
1 parent c5ada7d commit ea967e8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions projects/lib/src/lib/color-picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -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;
Expand Down

0 comments on commit ea967e8

Please sign in to comment.