Serial Print makes code work. Why?

try with this modified code for the function GFXbuttonswitch

void GFXbuttonswitch() {
  if (tft.touched()) {
    tft.touchRead(&tx, &ty);
    Serial.print(tx); Serial.print(", "); Serial.println(ty);
    switch (rotation) {
      case 0:
        tx = map(tx, TS_MINX, TS_MAXX, 0, tft.width());
        ty = map(ty, TS_MINY, TS_MAXY, 0, tft.height());
        break;
      case 1:
        // p.x, p.y reversed //
        tx = map(ty, TS_MINY, TS_MAXY, 0, tft.width());
        ty = map(tx, TS_MAXX, TS_MINX, 0, tft.height());
        break;
      case 2:
        tx = map(tx, TS_MAXX, TS_MINX, 0, tft.width());
        ty = map(ty, TS_MAXY, TS_MINY, 0, tft.height());
        break;
      case 3:
        // p.x, p.y reversed //
        tx = map(ty, TS_MAXY, TS_MINY, 0, tft.width());
        ty = map(tx, TS_MINX, TS_MAXX, 0, tft.height());
        break;
    }

    for (uint8_t b = 0; b < row * col; b++) {
      if (btn[b].contains(tx, ty)) {
        btn[b].press(true);
        btn[b].drawButton(true);
        currentHit = b;
        break;
      } else  {
        btn[b].press(false);
        if (b == lastHit) {
          btn[b].drawButton(false);
        }
      }
    }
    lastHit = currentHit;
  }
}