diff -r 6b0a5f4923d3 -r cf634bbf9e04 mapeditor.cpp --- a/mapeditor.cpp Thu Sep 17 09:41:09 2009 +0000 +++ b/mapeditor.cpp Wed Sep 23 11:59:54 2009 +0000 @@ -1183,22 +1183,26 @@ } } else { // selection != a FloatObj - if (seli->depth()==0) //FIXME-1 also moved mapcenters could be linked, but not working here... + if (seli->depth()==0) //FIXME-1 also moved mapcenters could be linked, but not working so far { - // Move MapCenter + // Move MapCenter // FIXME-1 scrolls way too much with shift pressed + lmosel->move (p-movingObj_start); if (e->buttons()== Qt::LeftButton && e->modifiers()==Qt::ShiftModifier) - ((BranchObj*)lmosel)->moveBy( - QPointF(p.x() -movingObj_start.x(), - p.y()-movingObj_start.y()) ); - else - lmosel->move (p.x() -movingObj_start.x(), p.y()-movingObj_start.y() ); - model->updateRelPositions(); + { + QPointF v; + v=lmosel->getAbsPos(); + for (int i=0; ibranchCount(); ++i) + { + seli->getBranchObjNum(i)->setRelPos(); + seli->getBranchObjNum(i)->setOrientation(); + } + } } else { if (seli->depth()==1) { // Move mainbranch - lmosel->move(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() ); + lmosel->move(p-movingObj_start); lmosel->setRelPos(); } else { @@ -1214,7 +1218,7 @@ } // depth>0 // Maybe we can relink temporary? - if (dsti) + if (dsti) // FIXME-1 check if dsti is ancestor of myself! { if (e->modifiers()==Qt::ControlModifier) { @@ -1585,6 +1589,8 @@ QList treeItemsNew; QList treeItemsOld; + bool do_reposition=false; + QModelIndex ix; foreach (ix,newsel.indexes() ) { @@ -1616,7 +1622,8 @@ { // reset tmp scrolled branches BranchItem *bi=(BranchItem*)ti; - bi->resetTmpUnscroll(); + if (bi->resetTmpUnscroll() ) + do_reposition=true; } if (ti->isBranchLikeType() || ti->getType()==TreeItem::Image) // Hide link if not needed @@ -1636,7 +1643,10 @@ { BranchItem *bi=(BranchItem*)ti; if (bi->hasScrolledParent(bi) ) - bi->tmpUnscroll(); + { + if (bi->parentBranch()->tmpUnscroll() ) + do_reposition=true; + } } scrollTo (ix); if (ti->isBranchLikeType() || ti->getType()==TreeItem::Image) @@ -1644,6 +1654,7 @@ ((MapItem*)ti)->getLMO()->updateVisibility(); } } + if (do_reposition) model->reposition(); // Reduce rectangles while (treeItemsNew.count() < selboxList.count() ) @@ -1663,7 +1674,6 @@ } - // Reposition rectangles QRectF bbox; QModelIndex index;