Skip to content

Commit 40d59f2

Browse files
author
timlinux
committedJan 23, 2006
Improve marker positioning
git-svn-id: http://svn.osgeo.org/qgis/trunk@4725 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 8966fc7 commit 40d59f2

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed
 

‎src/gui/qgsvectorlayer.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3358,12 +3358,8 @@ void QgsVectorLayer::drawFeature(QPainter* p, QgsFeature* fet, QgsMapToPixel * t
33583358

33593359
p->save();
33603360
p->scale(markerScaleFactor,markerScaleFactor);
3361-
p->drawPixmap(static_cast<int>(x / markerScaleFactor
3362-
- marker->width()
3363-
- marker->width() / 2),
3364-
static_cast<int>(y / markerScaleFactor
3365-
- marker->height()
3366-
- marker->height() / 2),
3361+
p->drawPixmap(static_cast<int>(x-(marker->width()/2)) ,
3362+
static_cast<int>(y-(marker->height()/2) ),
33673363
*marker);
33683364
p->restore();
33693365

@@ -3399,12 +3395,8 @@ void QgsVectorLayer::drawFeature(QPainter* p, QgsFeature* fet, QgsMapToPixel * t
33993395
needToTrim = true;
34003396
else
34013397
#endif
3402-
p->drawPixmap(static_cast<int>(x / markerScaleFactor
3403-
- marker->width()
3404-
- marker->width() / 2),
3405-
static_cast<int>(y / markerScaleFactor
3406-
- marker->height()
3407-
- marker->height() / 2),
3398+
p->drawPixmap(static_cast<int>(x-(marker->width()/2)) ,
3399+
static_cast<int>(y-(marker->height()/2) ),
34083400
*marker);
34093401
}
34103402
p->restore();

0 commit comments

Comments
 (0)
Please sign in to comment.