diff --git a/libraries/AP_Math/polygon.cpp b/libraries/AP_Math/polygon.cpp index b55f946383..5468257448 100644 --- a/libraries/AP_Math/polygon.cpp +++ b/libraries/AP_Math/polygon.cpp @@ -43,10 +43,10 @@ bool Polygon_outside(const Vector2 &P, const Vector2 *V, unsigned n) if ((V[i].y > P.y) == (V[j].y > P.y)) { continue; } - const int32_t dx1 = P.x - V[i].x; - const int32_t dx2 = V[j].x - V[i].x; - const int32_t dy1 = P.y - V[i].y; - const int32_t dy2 = V[j].y - V[i].y; + const T dx1 = P.x - V[i].x; + const T dx2 = V[j].x - V[i].x; + const T dy1 = P.y - V[i].y; + const T dy2 = V[j].y - V[i].y; const int8_t dx1s = (dx1 < 0) ? -1 : 1; const int8_t dx2s = (dx2 < 0) ? -1 : 1; const int8_t dy1s = (dy1 < 0) ? -1 : 1;