bigdataviewer / bigdataviewer-playground

BSD 2-Clause "Simplified" License
19 stars 5 forks source link

Bug in SourceAndConverterHelper.cloneConverter() #247

Closed tischi closed 2 years ago

tischi commented 2 years ago

@NicoKiaru

SourceAndConverterHelper.cloneConverter()

            if ((converter instanceof ColorConverter)&&(cvt instanceof ColorConverter)) {
                ((ColorConverter) cvt).setColor(((ColorConverter)converter).getColor());
            }

            if ((converter instanceof RealARGBColorConverter)&&(cvt instanceof RealARGBColorConverter)) {
                ((RealARGBColorConverter)cvt).setMin(((RealARGBColorConverter)converter).getMin());
                ((RealARGBColorConverter)cvt).setMax(((RealARGBColorConverter)converter).getMax());
            }

We do not need the second if statement, because already ColorConverter implements LinearRange which has setMin and setMax.

OK If I change this?

tischi commented 2 years ago

So it would be:

SourceAndConverterHelper.cloneConverter()

            if ((converter instanceof ColorConverter)&&(cvt instanceof ColorConverter)) {
                ((ColorConverter) cvt).setColor(((ColorConverter)converter).getColor());
                ((ColorConverter) cvt).setMin(((ColorConverter)converter).getMin());
                ((ColorConverter) cvt).setMax(((ColorConverter)converter).getMax());  
}
NicoKiaru commented 2 years ago

Ah, ok, sure!

tischi commented 2 years ago

@NicoKiaru Did you see the PR?

NicoKiaru commented 2 years ago

Merged. It 's present in version 0.4.2.