diff -r 2876353ea150 -r d251c7b2de54 vymmodel.cpp --- a/vymmodel.cpp Wed Sep 23 12:14:08 2009 +0000 +++ b/vymmodel.cpp Thu Oct 01 11:28:50 2009 +0000 @@ -1963,10 +1963,15 @@ BranchItem *selbi=getSelectedBranch(); if (selbi && selbi->depth()>0) { + // if no relPos have been set before, try to use current rel positions + if (selbi->getLMO()) + for (int i=0; ibranchCount();++i) + selbi->getBranchNum(i)->getBranchObj()->setRelPos(); + //QString oldsel=getSelectString(); if ( relinkBranch (selbi,rootItem,-1) ) saveState ( - selbi,QString("relink()"), //FIXME-1 add paramters + selbi,QString("relink()"), //FIXME-1 add paramters when detaching selbi,"detach ()", QString("Detach %1").arg(getObjectName(selbi)) ); @@ -2264,10 +2269,6 @@ { if (branch && dst) { - if (branch->depth()==0) - { - cout <<"VM::relinkBranch d=0 for "<getHeadingStd()<parent(); // Remove at current position @@ -2517,6 +2518,7 @@ if (bi->depth()==0) return false; if (bi->toggleScroll()) { + reposition(); QString u,r; r="scroll"; u="unscroll"; @@ -2546,21 +2548,21 @@ if (bi->toggleScroll()) { reposition(); - QString u,r; - u="scroll"; - r="unscroll"; - saveState( - bi, - QString ("%1 ()").arg(u), - bi, - QString ("%1 ()").arg(r), - QString ("%1 %2").arg(r).arg(getObjectName(bi)) - ); - emitDataHasChanged(bi); - emitSelectionChanged(); + QString u,r; + u="scroll"; + r="unscroll"; + saveState( + bi, + QString ("%1 ()").arg(u), + bi, + QString ("%1 ()").arg(r), + QString ("%1 %2").arg(r).arg(getObjectName(bi)) + ); + emitDataHasChanged(bi); + emitSelectionChanged(); mapScene->update(); //Needed for _quick_ update, even in 1.13.x - return true; - } + return true; + } } return false; } @@ -2657,6 +2659,7 @@ void VymModel::colorBranch (QColor c) { +cout << "VM::colBranch\n"; BranchItem *selbi=getSelectedBranch(); if (selbi) { @@ -4225,6 +4228,7 @@ } void VymModel::selectMapBackgroundImage () // FIXME-2 move to ME +// FIXME-4 for using background image: view.setCacheMode(QGraphicsView::CacheBackground); { Q3FileDialog *fd=new Q3FileDialog( NULL); fd->setMode (Q3FileDialog::ExistingFile); @@ -4400,6 +4404,7 @@ void VymModel::startAnimation(BranchObj *bo, const QPointF &start, const QPointF &dest) { + if (start==dest) return; if (bo && bo->getTreeItem()->depth()>0) { AnimPoint ap; @@ -4590,7 +4595,7 @@ void VymModel::emitSelectionChanged(const QItemSelection &newsel) { emit (selectionChanged(newsel,newsel)); // needed e.g. to update geometry in editor - emitShowSelection(); + //FIXME-3 emitShowSelection(); sendSelection(); }