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

changing geometry on shapes doesn't trigger relayout

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • fx1.2
    • fx1.1.1
    • javafx
    • WinXP SP2 + JDK 1.6.0_11

      Had to change "spacing" property to a new value then back to old value on VBox to refresh the view when updating the height of a single node within that VBox.
      Below codes can be used to re-produce the problem

      import javafx.stage.Stage;
      import javafx.scene.Scene;
      import javafx.scene.shape.Rectangle;
      import javafx.scene.paint.Color;
      import javafx.scene.layout.VBox;
      import javafx.scene.input.MouseEvent;

      var vBox: VBox;
      var vRect1: Rectangle;
      var vRect2: Rectangle;

      Stage {
          title: "VBox"
          width: 600
          height: 600
          visible: true

          scene: Scene{
                  content: [
                      vBox = VBox {
                          spacing: 10
                          content: [
                              vRect1 = Rectangle {
                                  x: 10
                                  y: 10
                                  width:200
                                  height:25
                                  stroke: Color.BLACK
                                  fill: Color.GREEN
                              }//Rectangle

                              vRect2 = Rectangle {
                                  x: 10
                                  y: 10
                                  width:200
                                  height:25
                                  stroke: Color.BLACK
                                  fill: Color.BLUE
                              }//Rectangle
                          ]
                          onMousePressed: function(e: MouseEvent) {
                              vRect1.height++;
                              // vBox.spacing++; // The workaround is to uncomment this line, and
                              // vBox.spacing--; // this line
                          }
                      }
                 ]
              } //Scene
      }//Stage

            amfowler Anne Fowler (Inactive)
            lianqli Lianqi Li (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: