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

Rotating a hidden HBox / VBox gives incorrect results

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • fx1.1
    • javafx
    • WinXP Prof, franca b03

      I'm showing a HBox containing a few nodes. The HBox is made hidden and some value is set for 'rotate' attribute. When the HBox is made visible, the result shows as if HBox was rotated around its origin instead of center. When a visible HBox is rotated, it rotates around its center.

      To reproduce, run the below code. Deselect the 'visible' checkbox and move the 'Rotate' slider. Select the 'visible' checkbox. It could be seen that the HBox shows rotated around its origin.

      import javafx.ext.swing.*;
      import javafx.scene.*;
      import javafx.stage.*;
      import javafx.scene.shape.*;
      import javafx.scene.paint.*;
      import javafx.scene.layout.*;

      var visible: Boolean = true;
      var rotate: Integer = 0;

      Stage {
          width: 500
          height: 400
          scene: Scene {
              content: [HBox {
                  content: [for (i in [0..10]) Rectangle {
                      width: 20
                      height: 20
                      fill: Color.RED
                      stroke: Color.GREEN
                      strokeWidth: 3
                  }]
                  rotate: bind rotate
                  visible: bind visible
              }, HBox {
                  content: [SwingCheckBox {
                      text: "Visible"
                      selected: bind visible with inverse
                      width: 80
                  }, SwingLabel {
                      text: "Rotation"
                  }, SwingSlider {
                      minimum: 0
                      maximum: 360
                      value: bind rotate with inverse
                      width: 150
                  }]
                  translateX: 50
                  translateY: 300
              }]
          }
      }

            kcr Kevin Rushforth
            gramachasunw Girish Ramachandran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: