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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: fx1.2
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported: