Program: 30404
Project: 30404
Buggy source:
public void draw(SpriteBatch batch,int inputX,int inputY){
  Inventory inventory=World.getInstance().getInventory();
  if (!inventory.isVisible())   return;
  if (autoCollapse) {
    if (previousNumItems != inventory.getNumItems()) {
      previousNumItems=inventory.getNumItems();
      collapse(false);
    }
    updateAutocollapse(inputX,inputY);
  }
  if (collapsed) {
    batch.draw(uncollapseIcon,collapsedBbox.x,collapsedBbox.y,collapsedBbox.width,collapsedBbox.height);
  }
 else {
    boolean horizontal=bbox.width > bbox.height;
    RectangleRenderer.draw(batch,bbox.getX(),bbox.getY(),bbox.getWidth(),bbox.getHeight(),BG_COLOR);
    batch.draw(uncollapseIcon,collapsedBbox.x,collapsedBbox.y,tileSize,tileSize);
    batch.draw(configIcon,configBbox.x,configBbox.y,configBbox.width,configBbox.height);
    if (scrollItemPos == 0) {
      batch.setColor(GRAY);
      batch.draw(leftArrowIcon,horizontal ? (itemsPos - 1) * tileSize : bbox.x,horizontal ? bbox.y : (itemsPos - 1) * tileSize,tileSize,tileSize);
      batch.setColor(Color.WHITE);
    }
 else {
      batch.draw(leftArrowIcon,horizontal ? (itemsPos - 1) * tileSize : bbox.x,horizontal ? bbox.y : (itemsPos - 1) * tileSize,tileSize,tileSize);
    }
    if (scrollItemPos + itemsSize >= inventory.getNumItems()) {
      batch.setColor(GRAY);
      batch.draw(rightArrowIcon,horizontal ? (itemsPos + itemsSize) * tileSize : bbox.x,horizontal ? bbox.y : (itemsPos + itemsSize) * tileSize,tileSize,tileSize);
      batch.setColor(Color.WHITE);
    }
 else {
      batch.draw(rightArrowIcon,horizontal ? (itemsPos + itemsSize) * tileSize : bbox.x,horizontal ? bbox.y : (itemsPos + itemsSize) * tileSize,tileSize,tileSize);
    }
    for (int i=scrollItemPos; i < inventory.getNumItems() && itemsSize > i - scrollItemPos; i++) {
      SpriteActor a=inventory.getItem(i);
      float size=tileSize / a.getHeight() / a.getScale();
      a.getRenderer().draw(batch,horizontal ? (i + itemsPos - scrollItemPos) * tileSize : bbox.x,horizontal ? bbox.y : (i + itemsPos - scrollItemPos) * tileSize,0,0,size);
    }
  }
  if (draggedActor != null) {
    float w=draggedActor.getWidth() / draggedActor.getScale();
    float h=draggedActor.getHeight() / draggedActor.getScale();
    float size=tileSize / h * 1.3f;
    draggedActor.getRenderer().draw(batch,inputX - w / 2,inputY - h / 2,w / 2,h / 2,size);
    scrollTime+=Gdx.graphics.getDeltaTime();
    if (scrollTime > SCROLL_TIME) {
      scrollTime=0;
      updateScroll(inputX,inputY);
    }
  }
}

Fixed version (ground truth):
public void draw(SpriteBatch batch,int inputX,int inputY){
  Inventory inventory=World.getInstance().getInventory();
  if (!inventory.isVisible())   return;
  if (autoCollapse) {
    if (previousNumItems != inventory.getNumItems()) {
      previousNumItems=inventory.getNumItems();
      collapse(false);
    }
    updateAutocollapse(inputX,inputY);
  }
  if (collapsed) {
    batch.draw(uncollapseIcon,collapsedBbox.x,collapsedBbox.y,collapsedBbox.width,collapsedBbox.height);
  }
 else {
    boolean horizontal=bbox.width > bbox.height;
    RectangleRenderer.draw(batch,bbox.getX(),bbox.getY(),bbox.getWidth(),bbox.getHeight(),BG_COLOR);
    batch.draw(uncollapseIcon,collapsedBbox.x,collapsedBbox.y,tileSize,tileSize);
    batch.draw(configIcon,configBbox.x,configBbox.y,configBbox.width,configBbox.height);
    if (scrollItemPos == 0) {
      batch.setColor(GRAY);
      batch.draw(leftArrowIcon,horizontal ? (itemsPos - 1) * tileSize : bbox.x,horizontal ? bbox.y : (itemsPos - 1) * tileSize,tileSize,tileSize);
      batch.setColor(Color.WHITE);
    }
 else {
      batch.draw(leftArrowIcon,horizontal ? (itemsPos - 1) * tileSize : bbox.x,horizontal ? bbox.y : (itemsPos - 1) * tileSize,tileSize,tileSize);
    }
    if (scrollItemPos + itemsSize >= inventory.getNumItems()) {
      batch.setColor(GRAY);
      batch.draw(rightArrowIcon,horizontal ? (itemsPos + itemsSize) * tileSize : bbox.x,horizontal ? bbox.y : (itemsPos + itemsSize) * tileSize,tileSize,tileSize);
      batch.setColor(Color.WHITE);
    }
 else {
      batch.draw(rightArrowIcon,horizontal ? (itemsPos + itemsSize) * tileSize : bbox.x,horizontal ? bbox.y : (itemsPos + itemsSize) * tileSize,tileSize,tileSize);
    }
    for (int i=scrollItemPos; i < inventory.getNumItems() && itemsSize > i - scrollItemPos; i++) {
      SpriteActor a=inventory.getItem(i);
      float size=tileSize / a.getHeight() / a.getScale();
      a.getRenderer().draw(batch,horizontal ? (i + itemsPos - scrollItemPos) * tileSize + a.getWidth() * size / 2 : bbox.x + a.getWidth() * size / 2,horizontal ? bbox.y : (i + itemsPos - scrollItemPos) * tileSize,size);
    }
  }
  if (draggedActor != null) {
    float h=draggedActor.getHeight() / draggedActor.getScale();
    float size=tileSize / h * 1.3f;
    draggedActor.getRenderer().draw(batch,inputX,inputY - h * size / 2,size);
    scrollTime+=Gdx.graphics.getDeltaTime();
    if (scrollTime > SCROLL_TIME) {
      scrollTime=0;
      updateScroll(inputX,inputY);
    }
  }
}