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

VPos.BASELINE does not work for layouts (Flow, HBox, etc.)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • fx1.2
    • javafx

      Bug discovered in the JavaFX 1.2 release

      The VPos setting of BASELINE seems to be unimplemented. Setting it has exactly the same effect as VPos.BOTTOM.

      Here is a simple example that illustrates the defect (also attached as a source file):
      Flow {
          nodeVPos: VPos.BASELINE
          content: [
              Text {
                  content: "I have no descenders"
                  textOrigin: TextOrigin.BASELINE
              }
              Text {
                  content: "Why am I so high?"
                  textOrigin: TextOrigin.BASELINE
              }
          ]
      }

      The expected behavior is that the two Text node will be aligned by their baselines.

      The actual behavior is that the Text nodes are aligned by their layoutBounds, which means the second Text field appears higher than the first. (see the attached screen capture)

      HBox gives exactly the same results, as does setting a vpos of BASELINE on Node.layoutInfo.

            amfowler Anne Fowler (Inactive)
            schin Stephen Chin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: