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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: 8u20
    • Fix Version/s: 8u40
    • Component/s: javafx
    • Labels:
      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

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported: