AmonRaNet / QGeoView

QGeoView is a Qt / C ++ widget for visualizing geographic data.
GNU Lesser General Public License v3.0
155 stars 60 forks source link

Movable and Transformed QGVDrawItem #20

Closed JaiPasdeBol closed 2 years ago

JaiPasdeBol commented 2 years ago

Hello,

Just to warn you that in case we do a rectangle which is both Movable and Transformed we need to add "refresh" inside the "projOnObjectMovePos" function otherwise the movement may be strange.

void Rectangle::projOnObjectMovePos(const QPointF& projPos)
{
    mProjRect.moveCenter(projPos);
    mGeoRect = getMap()->getProjection()->projToGeo(mProjRect);
    resetBoundary();
    refresh();
    qInfo() << "object moved" << mGeoRect;
} 

I think it's correct, but maybe would you find a more efficient way to correct it...

JPB

AmonRaNet commented 2 years ago

You are right - fixed. Actually only refresh() is enough. Nice catch!