Program: 30212
Project: 30212
Buggy source:
@Override public void act(float delta){
  super.act(delta);
  Text currentSubtitle=World.getInstance().getTextManager().getCurrentText();
  if (subtitle != currentSubtitle) {
    subtitle=currentSubtitle;
    if (currentSubtitle == null && isVisible()) {
      setVisible(false);
    }
 else     if (currentSubtitle != null && !isVisible()) {
      setVisible(true);
    }
    if (isVisible()) {
      float posx=currentSubtitle.x;
      float posy=currentSubtitle.y;
      unprojectTmp.set(posx,posy,0);
      World.getInstance().getSceneCamera().scene2screen(getStage().getViewport(),unprojectTmp);
      float maxWidth=currentSubtitle.type == Text.Type.TALK ? maxTalkWidth : maxRectangleWidth;
      final TextManagerUIStyle style=getStyle(currentSubtitle);
      Color color=currentSubtitle.color != null ? currentSubtitle.color : style.defaultColor;
      if (color == null)       color=Color.BLACK;
      layout.setText(style.font,currentSubtitle.str,color,maxWidth,Align.center,true);
      if (posx == TextManager.POS_CENTER || posx == TextManager.POS_SUBTITLE) {
        posx=(getStage().getViewport().getScreenWidth() - layout.width) / 2;
        fontX=(getStage().getViewport().getScreenWidth() - maxWidth) / 2;
      }
 else {
        posx=unprojectTmp.x;
        fontX=unprojectTmp.x;
      }
      if (posy == TextManager.POS_CENTER) {
        posy=(getStage().getViewport().getScreenHeight() - layout.height) / 2;
      }
 else       if (posy == TextManager.POS_SUBTITLE) {
        posy=getStage().getViewport().getScreenHeight() - layout.height - DPIUtils.getMarginSize() * 4;
      }
 else {
        posy=unprojectTmp.y;
      }
      setPosition(posx - PADDING,posy - PADDING);
      setSize(layout.width + PADDING * 2,layout.height + PADDING * 2);
      if (currentSubtitle.type == Text.Type.TALK) {
        if (style.talkBubble != null) {
          setY(getY() + DPIUtils.getTouchMinSize() / 3 + PADDING);
        }
 else {
          setY(getY() + PADDING);
        }
        setX(getX() - layout.width / 2);
        fontX=posx - maxWidth / 2;
        if (getX() < 0 && getX() > -getWidth()) {
          setX(0 + PADDING);
          fontX=getX() + PADDING + (layout.width - maxWidth) / 2;
        }
 else         if (getX() + getWidth() > getStage().getViewport().getScreenWidth() && getX() + getWidth() < getStage().getViewport().getScreenWidth() + getWidth()) {
          setX(getStage().getViewport().getScreenWidth() - getWidth());
          fontX=getStage().getViewport().getScreenWidth() - layout.width / 2 - PADDING - maxWidth / 2;
        }
        if (getY() + getHeight() > getStage().getViewport().getScreenHeight()) {
          setY(getStage().getViewport().getScreenHeight() - getHeight() - PADDING);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void act(float delta){
  super.act(delta);
  Text currentSubtitle=World.getInstance().getTextManager().getCurrentText();
  if (subtitle != currentSubtitle) {
    subtitle=currentSubtitle;
    if (currentSubtitle == null && isVisible()) {
      setVisible(false);
    }
 else     if (currentSubtitle != null && !isVisible()) {
      setVisible(true);
    }
    if (isVisible()) {
      float posx=currentSubtitle.x;
      float posy=currentSubtitle.y;
      unprojectTmp.set(posx,posy,0);
      World.getInstance().getSceneCamera().scene2screen(getStage().getViewport(),unprojectTmp);
      float maxWidth=currentSubtitle.type == Text.Type.TALK ? maxTalkWidth : maxRectangleWidth;
      final TextManagerUIStyle style=getStyle(currentSubtitle);
      Color color=currentSubtitle.color != null ? currentSubtitle.color : style.defaultColor;
      if (color == null)       color=Color.BLACK;
      layout.setText(style.font,currentSubtitle.str,color,maxWidth,Align.center,true);
      if (posx == TextManager.POS_CENTER || posx == TextManager.POS_SUBTITLE) {
        posx=(getStage().getViewport().getScreenWidth() - layout.width) / 2;
        fontX=(getStage().getViewport().getScreenWidth() - maxWidth) / 2;
      }
 else {
        posx=unprojectTmp.x;
        fontX=posx + (layout.width - maxWidth) / 2;
      }
      if (posy == TextManager.POS_CENTER) {
        posy=(getStage().getViewport().getScreenHeight() - layout.height) / 2;
      }
 else       if (posy == TextManager.POS_SUBTITLE) {
        posy=getStage().getViewport().getScreenHeight() - layout.height - DPIUtils.getMarginSize() * 4;
      }
 else {
        posy=unprojectTmp.y;
      }
      setPosition(posx - PADDING,posy - PADDING);
      setSize(layout.width + PADDING * 2,layout.height + PADDING * 2);
      if (currentSubtitle.type == Text.Type.TALK) {
        if (style.talkBubble != null) {
          setY(getY() + DPIUtils.getTouchMinSize() / 3 + PADDING);
        }
 else {
          setY(getY() + PADDING);
        }
        setX(getX() - layout.width / 2);
        fontX=posx - maxWidth / 2;
        if (getX() < 0 && getX() > -getWidth()) {
          setX(0 + PADDING);
          fontX=getX() + PADDING + (layout.width - maxWidth) / 2;
        }
 else         if (getX() + getWidth() > getStage().getViewport().getScreenWidth() && getX() + getWidth() < getStage().getViewport().getScreenWidth() + getWidth()) {
          setX(getStage().getViewport().getScreenWidth() - getWidth());
          fontX=getStage().getViewport().getScreenWidth() - layout.width / 2 - PADDING - maxWidth / 2;
        }
        if (getY() + getHeight() > getStage().getViewport().getScreenHeight()) {
          setY(getStage().getViewport().getScreenHeight() - getHeight() - PADDING);
        }
      }
    }
  }
}