Fixed bug with distance calculations... distance <> slope

This commit is contained in:
2011-06-22 22:47:56 -04:00
parent 5b53e0b115
commit 1606dfb058
2 changed files with 11 additions and 11 deletions

View File

@ -1,9 +1,6 @@
#include "gamecore.h"
#include "drawutils.h"
#ifdef DEBUG
#include <iostream>
#endif
#include "debug.h"
int GameCore::NODE_SIZE = 25;
int GameCore::MAX_MOVE_DISTANCE = 200;
@ -132,6 +129,14 @@ void GameCore::on_lbutton_down(int x, int y)
new_v.x = x;
new_v.y = y;
#ifdef DEBUG
if (v != NULL)
cerr << "debug: GameCore::on_lbutton_down(): distance="
<< Vertex::distance(*v, new_v) << "\n";
else
cerr << "debug: GameCore::on_lbutton_down(): distance=0, current_vertex is NULL\n";
#endif
if (v != NULL && (Vertex::distance(*v, new_v) > MAX_MOVE_DISTANCE))
return;