Lines 16-21
Link Here
|
16 |
|
16 |
|
17 |
#include <kdebug.h> |
17 |
#include <kdebug.h> |
18 |
#include <assert.h> |
18 |
#include <assert.h> |
|
|
19 |
#include <cmath> |
19 |
|
20 |
|
20 |
NodeGroup::NodeGroup( ICNDocument *icnDocument, const char *name ) |
21 |
NodeGroup::NodeGroup( ICNDocument *icnDocument, const char *name ) |
21 |
: QObject( icnDocument, name ) |
22 |
: QObject( icnDocument, name ) |
Lines 274-280
Link Here
|
274 |
{ |
275 |
{ |
275 |
if ( *it1 != *it2 && (*it1)->y() == (*it2)->y() && canRoute( *it1, *it2 ) ) |
276 |
if ( *it1 != *it2 && (*it1)->y() == (*it2)->y() && canRoute( *it1, *it2 ) ) |
276 |
{ |
277 |
{ |
277 |
const int distance = std::abs(int( (*it1)->x()-(*it2)->x() )); |
278 |
const int distance = std::abs((double)( (*it1)->x()-(*it2)->x() )); |
278 |
if ( distance < shortest ) |
279 |
if ( distance < shortest ) |
279 |
{ |
280 |
{ |
280 |
shortest = distance; |
281 |
shortest = distance; |
Lines 296-302
Link Here
|
296 |
{ |
297 |
{ |
297 |
if ( *it1 != *it2 && (*it1)->x() == (*it2)->x() && canRoute( *it1, *it2 ) ) |
298 |
if ( *it1 != *it2 && (*it1)->x() == (*it2)->x() && canRoute( *it1, *it2 ) ) |
298 |
{ |
299 |
{ |
299 |
const int distance = std::abs(int( (*it1)->y()-(*it2)->y() )); |
300 |
const int distance = std::abs((double)( (*it1)->y()-(*it2)->y() )); |
300 |
if ( distance < shortest ) |
301 |
if ( distance < shortest ) |
301 |
{ |
302 |
{ |
302 |
shortest = distance; |
303 |
shortest = distance; |
Lines 320-326
Link Here
|
320 |
{ |
321 |
{ |
321 |
const int dx = (int)((*it1)->x()-(*it2)->x()); |
322 |
const int dx = (int)((*it1)->x()-(*it2)->x()); |
322 |
const int dy = (int)((*it1)->y()-(*it2)->y()); |
323 |
const int dy = (int)((*it1)->y()-(*it2)->y()); |
323 |
const int distance = std::abs(dx) + std::abs(dy); |
324 |
const int distance = std::abs((double)dx) + std::abs((double)dy); |
324 |
if ( distance < shortest ) |
325 |
if ( distance < shortest ) |
325 |
{ |
326 |
{ |
326 |
shortest = distance; |
327 |
shortest = distance; |