Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix rendering off added features
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8454 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed May 17, 2008
1 parent 4c62a08 commit 80cacae
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -819,13 +819,13 @@ bool QgsVectorLayer::draw(QgsRenderContext& renderContext)
sel = FALSE;
}

//QgsDebugMsg(QString("markerScale before renderFeature(): %1").arg(markerScaleFactor));
// markerScalerFactore reflects the wanted scaling of the marker
//QgsDebugMsg(QString("markerScale before renderFeature(): %1").arg(markerScaleFactor));
// markerScalerFactore reflects the wanted scaling of the marker
mRenderer->renderFeature(renderContext.painter(), fet, &marker, sel, renderContext.scaleFactor(), renderContext.rasterScaleFactor());
// markerScalerFactore now reflects the actual scaling of the marker that the render performed.
//QgsDebugMsg(QString("markerScale after renderFeature(): %1").arg(markerScaleFactor));
// markerScalerFactore now reflects the actual scaling of the marker that the render performed.
//QgsDebugMsg(QString("markerScale after renderFeature(): %1").arg(markerScaleFactor));

double scale = renderContext.scaleFactor() / markerScaleFactor;
//double scale = renderContext.scaleFactor() / markerScaleFactor;
drawFeature(renderContext.painter() , fet, &(renderContext.mapToPixel()), renderContext.coordTransform(), &marker, renderContext.scaleFactor(), renderContext.rasterScaleFactor(), renderContext.drawEditingInformation());

++featureCount;
Expand All @@ -838,12 +838,11 @@ bool QgsVectorLayer::draw(QgsRenderContext& renderContext)
for(; it != mAddedFeatures.end(); ++it)
{
bool sel = mSelectedFeatureIds.contains((*it).featureId());
QgsDebugMsg(QString("markerScale before renderFeature(): %1").arg(markerScaleFactor));
// markerScalerFactore reflects the wanted scaling of the marker
mRenderer->renderFeature(renderContext.painter(), *it, &marker, &markerScaleFactor,
sel, renderContext.scaleFactor());
// markerScalerFactore now reflects the actual scaling of the marker that the render performed.
QgsDebugMsg(QString("markerScale after renderFeature(): %1").arg(markerScaleFactor));
//QgsDebugMsg(QString("markerScale before renderFeature(): %1").arg(markerScaleFactor));
// markerScalerFactore reflects the wanted scaling of the marker
mRenderer->renderFeature(renderContext.painter(), *it, &marker, sel, renderContext.scaleFactor(), renderContext.rasterScaleFactor());
// markerScalerFactore now reflects the actual scaling of the marker that the render performed.
//QgsDebugMsg(QString("markerScale after renderFeature(): %1").arg(markerScaleFactor));

//double scale = renderContext.scaleFactor() / markerScaleFactor;

Expand Down Expand Up @@ -2797,7 +2796,7 @@ bool QgsVectorLayer::snapPoint(QgsPoint& point, double tolerance)
}


int QgsVectorLayer::snapWithContext(const QgsPoint& startPoint, double snappingTolerance, QMultiMap<double, QgsSnappingResult>& snappingResults, \
int QgsVectorLayer::snapWithContext(const QgsPoint& startPoint, double snappingTolerance, QMultiMap<double, QgsSnappingResult>& snappingResults,
QgsSnapper::SNAP_TO snap_to)
{
if (snappingTolerance<=0 || !mDataProvider)
Expand All @@ -2806,7 +2805,7 @@ int QgsVectorLayer::snapWithContext(const QgsPoint& startPoint, double snappingT
}

QList<QgsFeature> featureList;
QgsRect searchRect(startPoint.x()-snappingTolerance, startPoint.y()-snappingTolerance, \
QgsRect searchRect(startPoint.x()-snappingTolerance, startPoint.y()-snappingTolerance,
startPoint.x()+snappingTolerance, startPoint.y()+snappingTolerance);
double sqrSnappingTolerance = snappingTolerance * snappingTolerance;

Expand All @@ -2824,7 +2823,7 @@ int QgsVectorLayer::snapWithContext(const QgsPoint& startPoint, double snappingT
return 0;
}

void QgsVectorLayer::snapToGeometry(const QgsPoint& startPoint, int featureId, QgsGeometry* geom, double sqrSnappingTolerance, \
void QgsVectorLayer::snapToGeometry(const QgsPoint& startPoint, int featureId, QgsGeometry* geom, double sqrSnappingTolerance,
QMultiMap<double, QgsSnappingResult>& snappingResults, QgsSnapper::SNAP_TO snap_to) const
{
if(!geom)
Expand Down

0 comments on commit 80cacae

Please sign in to comment.