Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8094594

[Charts, Axis] TickMark's textVisible property is ignored

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P5
    • 8u40
    • 8u20
    • javafx
    • None

    Description

      The following `for` loop can be found in `javafx.scence.chart.Axis`

      {code:java}
      int stop = 0;
      for (; stop < tickMarks.size(); ++stop) {
          TickMark<T> m = tickMarks.get(stop);
          if (m.isTextVisible()) {
              double tickHeight = measureTickMarkSize(m.getValue(), getRange()).getHeight();
              lastStart = updateAndGetDisplayPosition(m) - tickHeight / 2;
          }
          break;
      }
      {code}

      This always breaks after the first iteration and therefore the `for` statement could be removed. A simple if could check for `tickMarks.size()` being `> 0`.

      Attachments

        Activity

          People

            msladecek Martin Sládeček
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: