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

StrokeType.OUTER is not well defined for unclosed shapes and paths

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 8u20
    • 8
    • javafx

    Description

      Arc seems unable to draw an ordinary mathematical arc. As the attached image shows, Arc draws some strange end caps even when StrokeLineCap.BUTT and ArcType.OPEN is chosen.

      This affects the latest JavaFX8 shipped with Java 8.

      Code excerpt:


      arc = new Arc();
      arc.setType(ArcType.OPEN);
      arc.setStartAngle(0);
      arc.setLength(0);

      timeline = new Timeline(
      new KeyFrame(
      Duration.ZERO,
      new KeyValue(arc.startAngleProperty(), 90),
      new KeyValue(arc.lengthProperty(), 0)
      ),
      new KeyFrame(
      Duration.millis(2000),
      new KeyValue(arc.startAngleProperty(), 90),
      new KeyValue(arc.lengthProperty(), -360)
      ),
      new KeyFrame(
      Duration.millis(4000),
      new KeyValue(arc.startAngleProperty(), -270),
      new KeyValue(arc.lengthProperty(), 0)
      )
      );
      timeline.setCycleCount(Timeline.INDEFINITE);

      double size = 48;
      double strokeWidth = 4;
      double radius = size / 2 - strokeWidth;

      arc.setCenterX(radius);
      arc.setCenterY(radius);
      arc.setRadiusX(radius);
      arc.setRadiusY(radius);

      arc.setFill(null);
      arc.setStroke(new Color(1.0, 1.0, 1.0, 0.9));
      arc.setStrokeType(StrokeType.OUTSIDE);
      arc.setStrokeWidth(strokeWidth);
      arc.setStrokeLineCap(StrokeLineCap.BUTT);

      NodeUtility.setOnlySize(this, radius * 2);

      Attachments

        Activity

          People

            flar Jim Graham
            risaksen Randahl Isaksen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: