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

It's annoying removing an anchor may set a prefwidth/prefHeight

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7u6
    • javafx
    • None

      Drop an asset on content, say an Hyperlink.
      Set its left anchor then its right anchor.
      Now remove the right anchor -> a prefWidth is set.
      If in place of removing the right anchor I would have called Undo the prefWidth wouldn't have been set.

      Note that is a prefWidth/prefHeight is already defined when you anchor / un-anchor then the prefWidth/prefHeight is not modified. This is correct.

      One car reasonably set and remove an anchor without realizing prefWidth/prefHeight are set. But the consequence of having a prefSize is significant at runtime for objects like hyperlink, label and so on: if the text to display is bigger than what it was when you were in the Scene Builder then it will be truncated. If on the contrary you don't have prefWidth/prefHeight the control adjusts its size to fit the text.
      This is fairly different and today our tool doesn't really help the user to discriminate the two cases so that if he takes a path or another we're sure it's intentional.

      When an anchor is removed then the Layout action taken when the anchor were put, if any, is reverted: does-it sound like a possible fix ?
      From there is the user really want to set a prefWidth/prefHeight then he takes a resize action on content panel or set a numerical value in the inspector.

            dfuchs Daniel Fuchs
            yjoan Yves Joan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: