diff --git a/draw/Image.cpp b/draw/Image.cpp index b4697e3..8267bb0 100644 --- a/draw/Image.cpp +++ b/draw/Image.cpp @@ -408,8 +408,8 @@ void draw::Image::DistanceField(etk::Vector2D pos, etk::Vector2D elem1 = grid1.Get(tmpPos); etk::Vector2D elem2 = grid2.Get(tmpPos); // Calculate the actual distance from the x/y - float dist1 = sqrt( (double)elem1.QuadDist() ); - float dist2 = sqrt( (double)elem2.QuadDist() ); + float dist1 = elem1.GetLength(); + float dist2 = elem2.GetLength(); float dist = dist1 - dist2; /* if (tmpPos.y < 32) { diff --git a/draw/Image.h b/draw/Image.h index ca016fb..45e3d77 100644 --- a/draw/Image.h +++ b/draw/Image.h @@ -173,7 +173,7 @@ class Grid etk::Vector2D other = Get(pos); other.x += offsetx; other.y += offsety; - if (other.QuadDist() < p.QuadDist()) { + if (other.GetSquaredLength() < p.GetSquaredLength()) { p = other; } };