Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Removed the need for updatePositionManual - when you want to implemen…
…t custom position

logic simply override updatePosition...




git-svn-id: http://svn.osgeo.org/qgis/trunk@5129 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Apr 1, 2006
1 parent 233cf5a commit 0776750
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/plugins/georeferencer/qgsgeorefdatapoint.cpp
Expand Up @@ -8,7 +8,6 @@ QgsGeorefDataPoint::QgsGeorefDataPoint(QgsMapCanvas* mapCanvas, int id,
: QgsMapCanvasItem(mapCanvas), mId(id),
mPixelCoords(pixelCoords), mMapCoords(mapCoords)
{
mResizeType = ResizeManual;
updatePosition();
}

Expand All @@ -35,14 +34,14 @@ void QgsGeorefDataPoint::drawShape(QPainter & p)
setSize(textBounds.width() + 6, textBounds.height() + 6);
}

void QgsGeorefDataPoint::updatePositionManual()
void QgsGeorefDataPoint::updatePosition()
{
QPoint pt = toCanvasCoords(mPixelCoords);
move(pt.x() - 2, pt.y() - 2);
show();

//#ifdef QGISDEBUG
std::cout << "georefDataPoint::updatePositionManual: " << pt.x() << "," << pt.y() << std::endl;
std::cout << "georefDataPoint::updatePosition: " << pt.x() << "," << pt.y() << std::endl;
//#endif

}
2 changes: 1 addition & 1 deletion src/plugins/georeferencer/qgsgeorefdatapoint.h
Expand Up @@ -15,7 +15,7 @@ class QgsGeorefDataPoint : public QgsMapCanvasItem
virtual void drawShape(QPainter & p);

//! handler for manual updating of position and size
virtual void updatePositionManual();
virtual void updatePosition();

//! returns coordinates of the point
QgsPoint pixelCoords() { return mPixelCoords; }
Expand Down
5 changes: 2 additions & 3 deletions src/plugins/grass/qgsgrassedit.cpp
Expand Up @@ -76,16 +76,15 @@ class QgsGrassEditLayer : public QgsMapCanvasItem

QgsGrassEditLayer(QgsMapCanvas* mapCanvas):QgsMapCanvasItem(mapCanvas)
{
setResizeType(ResizeManual);
updatePositionManual();
updatePosition();
}

virtual void drawShape(QPainter & p)
{
p.drawPixmap(0,0, mPixmap);
}

virtual void updatePositionManual()
virtual void updatePosition()
{
int width = mMapCanvas->size().width();
int height = mMapCanvas->size().height();
Expand Down

0 comments on commit 0776750

Please sign in to comment.