fix line tessellation

-js: 7cf7ef763d
This commit is contained in:
Ansis Brammanis
2015-04-28 18:14:34 -07:00
parent 32e00b5a03
commit 3e928f41c8

View File

@@ -183,8 +183,9 @@ void LineBucket::addGeometry(const std::vector<Coordinate>& vertices) {
// Almost parallel lines
joinNormal = nextNormal;
} else {
const float direction = prevNormal.x * nextNormal.y - prevNormal.y * nextNormal.x > 0 ? -1 : 1;
const float bevelLength = miterLength * util::mag(prevNormal + nextNormal) /
util::mag(prevNormal - nextNormal);
util::mag(prevNormal - nextNormal * direction);
joinNormal = util::perp(joinNormal) * bevelLength;
}