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

Line stroke width is not affected by applied transformations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • fx2.1
    • fx2.0
    • javafx
    • Product: javafx-2.0beta
      Platform: windows-i586
      Build-Number: 153
      Build-ID: 2011-05-10_22-27-35

      The following code fragment:

                  root = new Group();
                  Rectangle rect = new Rectangle( 10, 10, 100, 100);
                  rect.setFill( Color.RED);
                  rect.setStroke(Color.BLACK);
                  rect.setStrokeWidth(2);
                  root.getChildren().add( rect);

                  Line line = new Line( 1, 1, 150, 100);
                  line.setStroke( Color.BLACK);
                  line.setStrokeWidth(2);
                  
                  root.getChildren().add( line);

                  Scale scale = new Scale( 5, 5);
                  root.getTransforms().add(scale);

              // Create and show the stage
              stage.setWidth(800);
              stage.setHeight(600);
              Scene scene = new Scene(root);
              stage.setScene(scene);
              stage.setVisible(true);

      produces the scene visible in the attached screenshot. Please note that the rectangle's stroke width is, quite correctly, 10px (2 x 5) whereas the line stroke width is only 2px, as if there was no scale transformation at all.

            flar Jim Graham
            pbeneswse Pavel Benes (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: