phetsims / kite

A library for creating, manipulating and displaying 2D shapes in JavaScript.
http://scenerystack.org/
MIT License
15 stars 6 forks source link

Kite stroke on ellipse1 test broken #37

Closed jonathanolson closed 9 years ago

pixelzoom commented 9 years ago

Insufficient info in this issue for me to evaluate it. Since it's labeled "bug" and the title says "broken", I'll err on the safe side and label it "Summer 2015 redeploy".

jonathanolson commented 9 years ago

Good excuse to tackle it! Turns out that Kite's stroking logic for line caps and line joins was assuming it was getting normalized tangent vectors, whereas Segment's startTangent/endTangent aren't normalized (they are dx/dt, dy/dt). Caused the line-cap on the elliptical arc to be significantly shortened (when Kite did the stroking with getStrokedShape()).

The proper normalization is now in place, although it probably wasn't causing any simulation issues.