#781 GrayPaintScale.getPaint() uses wrong value

1.0.x
closed-fixed
David Gilbert
General (896)
5
2007-09-26
2007-08-03
Anonymous
No

GrayPaintScale's getPaint() lines 114 & 115 make sure that the we are within the upper and lower bounds for the current scale. However it accidentally disregards this check and uses the passed in value regardless of whether or not it is within the scale.

Fix:

Change line 116 from:
int g = (int) ((value - this.lowerBound) / (this.upperBound
- this.lowerBound) * 255.0);

To:

int g = (int) ((v - this.lowerBound) / (this.upperBound
- this.lowerBound) * 255.0);

Note the variable "value" has been replaced by the variable "v".

Discussion

  • David Gilbert
    David Gilbert
    2007-09-26

    • labels: --> General
    • milestone: --> 1.0.x
    • assigned_to: nobody --> mungady
    • status: open --> closed-fixed
     
  • David Gilbert
    David Gilbert
    2007-09-26

    Logged In: YES
    user_id=112975
    Originator: NO

    Thanks for the report. I've committed the fix to Subversion for inclusion in the 1.0.7 release.