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

Incorrect bounds are reported when image border is used

    XMLWordPrintable

Details

    Description

      The following pane:

                                      pane = PaneBuilder.create()
                                          .layoutX(50)
                                          .layoutY(50)
                                          .prefHeight(100)
                                          .prefWidth(100)
                                          .style("-fx-border-image-source: url(\"JavaFX.png\"); -fx-border-image-width: 20; -fx-border-image-slice: 20; ")
                                          .build(),

      Has the following bounds:

      pane.getBoundsInLocal() = BoundingBox [minX:-10.0, minY:-10.0, minZ:0.0, width:120.0, height:120.0, depth:0.0, maxX:110.0, maxY:110.0, maxZ:0.0]
      pane.getBoundsInParent() = BoundingBox [minX:40.0, minY:40.0, minZ:0.0, width:120.0, height:120.0, depth:0.0, maxX:160.0, maxY:160.0, maxZ:0.0]
      pane.getLayoutBounds() = BoundingBox [minX:0.0, minY:0.0, minZ:0.0, width:100.0, height:100.0, depth:0.0, maxX:100.0, maxY:100.0, maxZ:0.0]

      The screenshot shows that only layoutBounds are correct. Others include 10 pixels on each side which is incorrect as border is drawn inside the layout bounds.

      Attachments

        1. Bug.java
          4 kB
        2. JavaFX.png
          JavaFX.png
          6 kB
        3. screenshot-1.jpg
          screenshot-1.jpg
          9 kB

        Activity

          People

            ckyang Chien Yang (Inactive)
            mrkam Alexander Kuznetcov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: