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

Edge case for Region.boundedSize policy

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • P5
    • 9
    • 7-pool
    • javafx

    Description

      The min/max policy for sizing children in Region is enforced with calls like boundedSize(child.prefWidth(h), child.minWidth(h), child.maxWidth(h)).

      This policy states that if min > max, then min wins. This makes sense if both min and max are computed, or if both are set explicitly. There is one use case, however, where an application might set an explicit max, but not a min. In this case the max loses out if the computed min is larger, which seems wrong.

      I suggest that methods such as Region.computeChildPrefAreaWidth() takes this into account and calls boundedSize(child.prefWidth(h), child.maxWidth(h), child.maxWidth(h)) IFF (child.getMinWidth() < 0 && child.getMaxWidth() >= 0).

      There is a problem in that the getMin/MaxWidth/Height methods are defined in the Control class and is not accessible from Region. Another possibility might be to modify Control.getMinWidth/Height methods to return the max value in this particular case.

      Attachments

        Issue Links

          Activity

            People

              msladecek Martin Sládeček
              leifs Leif Samuelsson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: