diff -r 0fad394bc330 -r 31841b366d5e mapeditor.cpp --- a/mapeditor.cpp Wed Mar 10 15:36:19 2010 +0000 +++ b/mapeditor.cpp Mon Mar 15 11:49:42 2010 +0000 @@ -497,6 +497,7 @@ */ } +#include void MapEditor::autoLayout() { // Create list with all bounding polygons @@ -559,7 +560,7 @@ if (polygonCollision (polys.at(i),polys.at(j), QPointF(0,0)).intersect ) { collisions++; - //qDebug() << "Collision: "<getOrientation()); - // mapobjects[i]->moveBy(v.x(),v.y() ); - // mapobjects[i]->setRelPos(); - model->startAnimation ((BranchObj*)mapobjects[i], mapobjects[i]->getAbsPos(), mapobjects[i]->getAbsPos() + v); + if (!v.isNull()) + { + if (debug) cout<<" Moving "<getAbsPos()<<" -> "<getAbsPos() + v<<" "<moveBy(v.x(),v.y() ); + //mapobjects[i]->setRelPos(); + model->startAnimation ((BranchObj*)mapobjects[i], v); + if (debug) cout<reposition(); @@ -607,9 +615,9 @@ break; } */ + break; - //orientationChanged=false; } // loop if orientation has changed