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

Line stroke width is not affected by applied transformations

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: fx2.0
    • Fix Version/s: fx2.1
    • Component/s: javafx
    • Labels:
    • Environment:

      Product: javafx-2.0beta
      Platform: windows-i586
      Build-Number: 153
      Build-ID: 2011-05-10_22-27-35

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported: