Skip to content

Commit 0776750

Browse files
author
timlinux
committed
Removed the need for updatePositionManual - when you want to implement custom position
logic simply override updatePosition... git-svn-id: http://svn.osgeo.org/qgis/trunk@5129 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 233cf5a commit 0776750

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/plugins/georeferencer/qgsgeorefdatapoint.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ QgsGeorefDataPoint::QgsGeorefDataPoint(QgsMapCanvas* mapCanvas, int id,
88
: QgsMapCanvasItem(mapCanvas), mId(id),
99
mPixelCoords(pixelCoords), mMapCoords(mapCoords)
1010
{
11-
mResizeType = ResizeManual;
1211
updatePosition();
1312
}
1413

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

38-
void QgsGeorefDataPoint::updatePositionManual()
37+
void QgsGeorefDataPoint::updatePosition()
3938
{
4039
QPoint pt = toCanvasCoords(mPixelCoords);
4140
move(pt.x() - 2, pt.y() - 2);
4241
show();
4342

4443
//#ifdef QGISDEBUG
45-
std::cout << "georefDataPoint::updatePositionManual: " << pt.x() << "," << pt.y() << std::endl;
44+
std::cout << "georefDataPoint::updatePosition: " << pt.x() << "," << pt.y() << std::endl;
4645
//#endif
4746

4847
}

src/plugins/georeferencer/qgsgeorefdatapoint.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class QgsGeorefDataPoint : public QgsMapCanvasItem
1515
virtual void drawShape(QPainter & p);
1616

1717
//! handler for manual updating of position and size
18-
virtual void updatePositionManual();
18+
virtual void updatePosition();
1919

2020
//! returns coordinates of the point
2121
QgsPoint pixelCoords() { return mPixelCoords; }

src/plugins/grass/qgsgrassedit.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,15 @@ class QgsGrassEditLayer : public QgsMapCanvasItem
7676

7777
QgsGrassEditLayer(QgsMapCanvas* mapCanvas):QgsMapCanvasItem(mapCanvas)
7878
{
79-
setResizeType(ResizeManual);
80-
updatePositionManual();
79+
updatePosition();
8180
}
8281

8382
virtual void drawShape(QPainter & p)
8483
{
8584
p.drawPixmap(0,0, mPixmap);
8685
}
8786

88-
virtual void updatePositionManual()
87+
virtual void updatePosition()
8988
{
9089
int width = mMapCanvas->size().width();
9190
int height = mMapCanvas->size().height();

0 commit comments

Comments
 (0)