Program: 11954
Project: 11954
Buggy source:
public WndSettings(boolean inGame){
  super();
  if (inGame) {
    int w=BTN_HEIGHT;
    btnZoomOut=new RedButton(TXT_ZOOM_OUT){
      @Override protected void onClick(){
        zoom(Camera.main.zoom - 1);
      }
    }
;
    add(btnZoomOut.setRect(0,0,w,BTN_HEIGHT));
    btnZoomIn=new RedButton(TXT_ZOOM_IN){
      @Override protected void onClick(){
        zoom(Camera.main.zoom + 1);
      }
    }
;
    add(btnZoomIn.setRect(WIDTH - w,0,w,BTN_HEIGHT));
    add(new RedButton(TXT_ZOOM_DEFAULT){
      @Override protected void onClick(){
        zoom(PixelScene.defaultZoom);
      }
    }
.setRect(btnZoomOut.right(),0,WIDTH - btnZoomIn.width() - btnZoomOut.width(),BTN_HEIGHT));
    updateEnabled();
  }
 else {
    CheckBox btnScaleUp=new CheckBox(TXT_SCALE_UP){
      @Override protected void onClick(){
        super.onClick();
        PixelDungeon.scaleUp(checked());
      }
    }
;
    btnScaleUp.setRect(0,0,WIDTH,BTN_HEIGHT);
    btnScaleUp.checked(PixelDungeon.scaleUp());
    add(btnScaleUp);
  }
  CheckBox btnMusic=new CheckBox(TXT_MUSIC){
    @Override protected void onClick(){
      super.onClick();
      PixelDungeon.music(checked());
    }
  }
;
  btnMusic.checked(PixelDungeon.music());
  add(btnMusic);
  CheckBox btnSound=new CheckBox(TXT_SOUND){
    @Override protected void onClick(){
      super.onClick();
      PixelDungeon.soundFx(checked());
      Sample.INSTANCE.play(Assets.SND_CLICK);
    }
  }
;
  btnSound.setRect(0,btnMusic.bottom() + GAP,WIDTH,BTN_HEIGHT);
  btnSound.checked(PixelDungeon.soundFx());
  add(btnSound);
  Button lastBtn=btnSound;
  if (!inGame) {
    Application.ApplicationType type=Gdx.app.getType();
    if (type == Application.ApplicationType.Android || type == Application.ApplicationType.iOS) {
      RedButton btnOrientation=new RedButton(orientationText()){
        @Override protected void onClick(){
          PixelDungeon.landscape(!PixelDungeon.landscape());
        }
      }
;
      btnOrientation.setRect(0,btnSound.bottom() + GAP,WIDTH,BTN_HEIGHT);
      add(btnOrientation);
      lastBtn=btnOrientation;
    }
 else     if (type == Application.ApplicationType.Desktop) {
      RedButton btnKeymap=new RedButton(TXT_BINDINGS){
        @Override protected void onClick(){
          parent.add(new WndKeymap());
        }
      }
;
      btnKeymap.setRect(0,btnSound.bottom() + GAP,WIDTH,BTN_HEIGHT);
      add(btnKeymap);
      RedButton btnResolution=new RedButton(resolutionText()){
        @Override protected void onClick(){
          PixelDungeon.fullscreen(!PixelDungeon.fullscreen());
        }
      }
;
      btnResolution.enable(PixelDungeon.instance.getPlatformSupport().isFullscreenEnabled());
      btnResolution.setRect(0,btnKeymap.bottom() + GAP,WIDTH,BTN_HEIGHT);
      add(btnResolution);
      lastBtn=btnResolution;
    }
  }
 else {
    CheckBox btnBrightness=new CheckBox(TXT_BRIGHTNESS){
      @Override protected void onClick(){
        super.onClick();
        PixelDungeon.brightness(checked());
      }
    }
;
    btnBrightness.setRect(0,btnSound.bottom() + GAP,WIDTH,BTN_HEIGHT);
    btnBrightness.checked(PixelDungeon.brightness());
    add(btnBrightness);
    lastBtn=btnBrightness;
  }
  resize(WIDTH,(int)lastBtn.bottom());
}

Fixed version (ground truth):
public WndSettings(boolean inGame){
  super();
  if (inGame) {
    int w=BTN_HEIGHT;
    btnZoomOut=new RedButton(TXT_ZOOM_OUT){
      @Override protected void onClick(){
        zoom(Camera.main.zoom - 1);
      }
    }
;
    add(btnZoomOut.setRect(0,0,w,BTN_HEIGHT));
    btnZoomIn=new RedButton(TXT_ZOOM_IN){
      @Override protected void onClick(){
        zoom(Camera.main.zoom + 1);
      }
    }
;
    add(btnZoomIn.setRect(WIDTH - w,0,w,BTN_HEIGHT));
    add(new RedButton(TXT_ZOOM_DEFAULT){
      @Override protected void onClick(){
        zoom(PixelScene.defaultZoom);
      }
    }
.setRect(btnZoomOut.right(),0,WIDTH - btnZoomIn.width() - btnZoomOut.width(),BTN_HEIGHT));
    updateEnabled();
  }
 else {
    CheckBox btnScaleUp=new CheckBox(TXT_SCALE_UP){
      @Override protected void onClick(){
        super.onClick();
        PixelDungeon.scaleUp(checked());
      }
    }
;
    btnScaleUp.setRect(0,0,WIDTH,BTN_HEIGHT);
    btnScaleUp.checked(PixelDungeon.scaleUp());
    add(btnScaleUp);
  }
  CheckBox btnMusic=new CheckBox(TXT_MUSIC){
    @Override protected void onClick(){
      super.onClick();
      PixelDungeon.music(checked());
    }
  }
;
  btnMusic.setRect(0,BTN_HEIGHT + GAP,WIDTH,BTN_HEIGHT);
  btnMusic.checked(PixelDungeon.music());
  add(btnMusic);
  CheckBox btnSound=new CheckBox(TXT_SOUND){
    @Override protected void onClick(){
      super.onClick();
      PixelDungeon.soundFx(checked());
      Sample.INSTANCE.play(Assets.SND_CLICK);
    }
  }
;
  btnSound.setRect(0,btnMusic.bottom() + GAP,WIDTH,BTN_HEIGHT);
  btnSound.checked(PixelDungeon.soundFx());
  add(btnSound);
  Button lastBtn=btnSound;
  if (!inGame) {
    Application.ApplicationType type=Gdx.app.getType();
    if (type == Application.ApplicationType.Android || type == Application.ApplicationType.iOS) {
      RedButton btnOrientation=new RedButton(orientationText()){
        @Override protected void onClick(){
          PixelDungeon.landscape(!PixelDungeon.landscape());
        }
      }
;
      btnOrientation.setRect(0,btnSound.bottom() + GAP,WIDTH,BTN_HEIGHT);
      add(btnOrientation);
      lastBtn=btnOrientation;
    }
 else     if (type == Application.ApplicationType.Desktop) {
      RedButton btnKeymap=new RedButton(TXT_BINDINGS){
        @Override protected void onClick(){
          parent.add(new WndKeymap());
        }
      }
;
      btnKeymap.setRect(0,btnSound.bottom() + GAP,WIDTH,BTN_HEIGHT);
      add(btnKeymap);
      RedButton btnResolution=new RedButton(resolutionText()){
        @Override protected void onClick(){
          PixelDungeon.fullscreen(!PixelDungeon.fullscreen());
        }
      }
;
      btnResolution.enable(PixelDungeon.instance.getPlatformSupport().isFullscreenEnabled());
      btnResolution.setRect(0,btnKeymap.bottom() + GAP,WIDTH,BTN_HEIGHT);
      add(btnResolution);
      lastBtn=btnResolution;
    }
  }
 else {
    CheckBox btnBrightness=new CheckBox(TXT_BRIGHTNESS){
      @Override protected void onClick(){
        super.onClick();
        PixelDungeon.brightness(checked());
      }
    }
;
    btnBrightness.setRect(0,btnSound.bottom() + GAP,WIDTH,BTN_HEIGHT);
    btnBrightness.checked(PixelDungeon.brightness());
    add(btnBrightness);
    lastBtn=btnBrightness;
  }
  resize(WIDTH,(int)lastBtn.bottom());
}