diff -r 8814a667241a -r aa48c7b52549 mapcenterobj.cpp --- a/mapcenterobj.cpp Tue Jan 03 09:44:41 2006 +0000 +++ b/mapcenterobj.cpp Tue Jan 03 09:44:41 2006 +0000 @@ -46,13 +46,11 @@ void MapCenterObj::move (double x, double y) { BranchObj::move(x,y); - positionBBox(); } void MapCenterObj::moveBy (double x, double y) { - //BranchObj::moveBy(x,y); - move (x+absPos.x(),y+absPos.y() ); + BranchObj::moveBy(x,y); positionBBox(); } @@ -77,9 +75,8 @@ void MapCenterObj::updateLink() { // set childPos to middle of MapCenterObj - childPos=QPoint( - absPos.x() + QSize(getSize() ).width()/2, - absPos.y() + QSize(getSize() ).height()/2); + childPos.setX( clickBox.topLeft().x() + (int)(clickBox.width())/2 ); + childPos.setY( clickBox.topLeft().y() + (int)(clickBox.height())/2 ); parPos=childPos; BranchObj *b; for (b=branch.first(); b; b=branch.next() ) @@ -95,19 +92,15 @@ for (bo=branch.first(); bo; bo=branch.next() ) { lmo = bo->findMapObj(p, excludeLMO); - - if (lmo!= NULL) - { - return lmo; - } + if (lmo!= NULL) return lmo; } // is p in MapCenter? - if (inBBox (p) && (this != excludeLMO) ) return this; + if (inBox (p) && (this != excludeLMO) ) return this; // Search float images FloatImageObj *foi; for (foi=floatimage.first(); foi; foi=floatimage.next() ) - if (foi->inBBox(p) && (foi != excludeLMO) && foi->getParObj()!= excludeLMO) return foi; + if (foi->inBox(p) && (foi != excludeLMO) && foi->getParObj()!= excludeLMO) return foi; // nothing found return NULL; @@ -124,9 +117,29 @@ attribut("x2",QString().setNum(absPos.x()+width()-offset.x(),10)) + attribut("y2",QString().setNum(absPos.y()+height()-offset.y(),10)); + // Providing an ID for a branch makes export to XHTML easier + QString idAttr; + if (countXLinks()>0) + idAttr=attribut ("id",getSelectString()); + else + idAttr=""; + + QString linkAttr=getLinkAttr(); + + QString urlAttr; + if (!url.isEmpty()) + urlAttr=attribut ("url",url); + QString vymLinkAttr; + if (!vymLink.isEmpty()) + vymLinkAttr=attribut ("vymLink",convertToRel(mapEditor->getDestPath(),vymLink) ); + s=beginElement ("mapcenter" +attribut("absPosX",QString().setNum(absPos.x(),10)) +attribut("absPosY",QString().setNum(absPos.y(),10)) + +vymLinkAttr + +urlAttr + +linkAttr + +idAttr +attribut("frameType",frame->getFrameTypeName()) +areaAttr );