mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Remove NaN-check C assert calls in line drawing code.
Users can pass NaN point values into line drawing code. love shouldn't abort the entire program if that happens.
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
|
||||
// C++
|
||||
#include <algorithm>
|
||||
#include <assert.h>
|
||||
|
||||
// treat adjacent segments with angles between their directions <5 degree as straight
|
||||
static const float LINES_PARALLEL_EPS = 0.05f;
|
||||
@@ -192,7 +191,6 @@ void MiterJoinPolyline::renderEdge(std::vector<Vector2> &anchors, std::vector<Ve
|
||||
if (fabs(det) / (len_s * len_t) < LINES_PARALLEL_EPS && Vector2::dot(s, t) > 0)
|
||||
{
|
||||
// lines parallel, compute as u1 = q + ns * w/2, u2 = q - ns * w/2
|
||||
assert(ns == ns); //NaN check
|
||||
normals.push_back(ns);
|
||||
normals.push_back(-ns);
|
||||
}
|
||||
@@ -201,7 +199,6 @@ void MiterJoinPolyline::renderEdge(std::vector<Vector2> &anchors, std::vector<Ve
|
||||
// cramers rule
|
||||
float lambda = Vector2::cross((nt - ns), t) / det;
|
||||
Vector2 d = ns + s * lambda;
|
||||
assert(d == d); //NaN check
|
||||
normals.push_back(d);
|
||||
normals.push_back(-d);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user