Program: 56840
Project: 56840
Buggy source:
/** 
 * Render the color bars for selecting the color mapping
 * @param gl
 */
private void renderColorMapper(GLGraphics g,float w,float h,ColorMapper mapper){
  final float padding=getPadding();
  w=w - 2 * padding;
  h=h - 2 * padding;
  g.save();
  g.move(padding,padding);
  List<ColorMarkerPoint> markerPoints=mapper.getMarkerPoints();
  for (int i=0; i < markerPoints.size(); ++i) {
    ColorMarkerPoint markerPoint=markerPoints.get(i);
    Color color=markerPoint.getColor();
    g.color(color.r,color.g,color.b,0.3f);
    final float v=markerPoint.getMappingValue();
    if (markerPoint.hasLeftSpread()) {
      float spread=markerPoint.getLeftSpread();
      float from=(v - spread) * w;
      float to=v * w;
      g.fillRect(from,0,to - from,h);
      g.color(SPREAD_LINE_COLOR);
      g.incZ();
      if (hoveredLeft && hoveredSpread == i) {
        g.lineWidth(3.f);
      }
      g.drawLine(from,0,from,h);
      if (hoveredLeft && hoveredSpread == i) {
        g.lineWidth(1);
      }
      g.decZ();
    }
    if (markerPoint.hasRightSpread()) {
      float spread=markerPoint.getRightSpread();
      float from=v * w;
      float to=(v + spread) * w;
      g.fillRect(from,0,to - from,h);
      g.color(SPREAD_LINE_COLOR);
      g.incZ();
      if (!hoveredLeft && hoveredSpread == i) {
        g.lineWidth(3.f);
      }
      g.drawLine(to,0,to,h);
      if (!hoveredLeft && hoveredSpread == i) {
        g.lineWidth(1);
      }
      g.decZ();
    }
  }
  g.restore();
}

Fixed version (ground truth):
/** 
 * Render the color bars for selecting the color mapping
 * @param gl
 */
private void renderColorMapper(GLGraphics g,float w,float h,ColorMapper mapper){
  final float padding=getPadding();
  w=w - 2 * padding;
  h=h - 2 * padding;
  g.save();
  g.move(padding,padding);
  float lineHeight=this.showMarkerLabels ? h + padding - 1 : h;
  List<ColorMarkerPoint> markerPoints=mapper.getMarkerPoints();
  for (int i=0; i < markerPoints.size(); ++i) {
    ColorMarkerPoint markerPoint=markerPoints.get(i);
    Color color=markerPoint.getColor();
    g.color(color.r,color.g,color.b,0.3f);
    final float v=markerPoint.getMappingValue();
    if (markerPoint.hasLeftSpread()) {
      float spread=markerPoint.getLeftSpread();
      float from=(v - spread) * w;
      float to=v * w;
      g.fillRect(from,0,to - from,h);
      g.color(SPREAD_LINE_COLOR);
      g.incZ();
      if (hoveredLeft && hoveredSpread == i) {
        g.lineWidth(3.f);
      }
      g.drawLine(from,0,from,lineHeight);
      if (hoveredLeft && hoveredSpread == i) {
        g.lineWidth(1);
      }
      g.decZ();
      if (spread > HistogramRenderStyle.SPREAD_CAPTION_THRESHOLD)       renderCaption(g,v - spread,w,h);
    }
    if (markerPoint.hasRightSpread()) {
      float spread=markerPoint.getRightSpread();
      float from=v * w;
      float to=(v + spread) * w;
      g.fillRect(from,0,to - from,h);
      g.color(SPREAD_LINE_COLOR);
      g.incZ();
      if (!hoveredLeft && hoveredSpread == i) {
        g.lineWidth(3.f);
      }
      g.drawLine(to,0,to,lineHeight);
      if (!hoveredLeft && hoveredSpread == i) {
        g.lineWidth(1);
      }
      g.decZ();
      if (spread > HistogramRenderStyle.SPREAD_CAPTION_THRESHOLD)       renderCaption(g,v + spread,w,h);
    }
    renderCaption(g,v,w,h);
  }
  g.restore();
}