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

VirtualFlow creates unneeded empty cells

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • jfx20
    • jfx18, jfx19
    • javafx
    • None
    • b02

        When the VirtualFlow is asked to scroll to a specific item, that item is (in the next layoutChildren invocation) initially placed at the first row of the flow (1).
        If there are not enough items left to fill the remainder of the flow, and if the specific item is not the first one in the list, the contents of the flow are shifted down (2).

        Between (1) and (2) the remainder of the flow (the cells that won't be filled with real items) is filled with empty cells (because addTrailingCells() is called).

        Because of phase (2), these empty cells are never rendered (they are outside the viewport when the layoutChildren method returns) but their allocation and presence consume resources (e.g. methods to calculate the size are invoked).

        It would be better to do the check on empty rows after the specified item before we start filling the flow with empty cells. That way, addTrailingCells will only add empty cells when they are really required.

              jvos Johan Vos
              jvos Johan Vos
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: