From 9ca566ed85228973d9e442ee41d14d59e494a087 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 29 Oct 2012 18:05:27 +0100 Subject: [PATCH] [DEV] change the vector3D function --- draw/Image.cpp | 4 ++-- draw/Image.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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; } };