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

Calculation of tangent in PathTransition is poor

XMLWordPrintable

      The calculation of the tangent in a PathTransition is poor:
      1) The calculation is very inaccurate if the angle between consecutive line-segments is acute.
      2) The ClosePath-segment is not handled correctly.

      Run the attached script. It creates a simple path consisting of three line which form a triangle. An arrow is animated to follow the triangle and it is using OrientationType.ORTHOGONAL_TO_TANGENT to point in the direction of the current line.

      You can notice two issues:
      1) Starting from the second line-segment, the tangent is interpolated in such a way that the arrow shows in the correct direction at the end of the line. It follows, that the arrow is actually showing in wrong direction almost all the time.
      2) Between the third and the first line-segment, the direction jumps. The path is using a ClosePath-element at this point, one expects the same behavior as for all other corners.

            loneid Leonid Popov (Inactive)
            mheinrichs Michael Heinrichs (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: