Skip to content
Permalink
Browse files

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/qgis@5129 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Apr 1, 2006
1 parent 86dac70 commit 834d696656b08a35db8e9b2b1298413dc4921b0a
@@ -8,7 +8,6 @@ QgsGeorefDataPoint::QgsGeorefDataPoint(QgsMapCanvas* mapCanvas, int id,
: QgsMapCanvasItem(mapCanvas), mId(id),
mPixelCoords(pixelCoords), mMapCoords(mapCoords)
{
mResizeType = ResizeManual;
updatePosition();
}

@@ -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

}
@@ -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; }
@@ -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();

0 comments on commit 834d696

Please sign in to comment.
You can’t perform that action at this time.