changing geometry on shapes doesn't trigger relayout

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • fx1.2
    • Affects Version/s: fx1.1.1
    • Component/s: javafx
    • Environment:

      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

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

              Created:
              Updated:
              Resolved:
              Imported: