[QGIS Commit] r10687 - in trunk/qgis/src: core
plugins/diagram_overlay
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Thu Apr 30 08:52:19 EDT 2009
Author: mhugent
Date: 2009-04-30 08:52:19 -0400 (Thu, 30 Apr 2009)
New Revision: 10687
Modified:
trunk/qgis/src/core/qgspalobjectpositionmanager.cpp
trunk/qgis/src/plugins/diagram_overlay/qgsdiagramoverlay.cpp
Log:
Improved calls to PAL library
Modified: trunk/qgis/src/core/qgspalobjectpositionmanager.cpp
===================================================================
--- trunk/qgis/src/core/qgspalobjectpositionmanager.cpp 2009-04-30 09:00:48 UTC (rev 10686)
+++ trunk/qgis/src/core/qgspalobjectpositionmanager.cpp 2009-04-30 12:52:19 UTC (rev 10687)
@@ -58,7 +58,7 @@
return; //error
}
- pal::Layer* positionLayer = mPositionEngine.addLayer( QString::number( mNumberOfLayers ).toLocal8Bit().data(), 0, 1000000, labelArrangement, pal::PIXEL, 0.5, true, true, true );
+ pal::Layer* positionLayer = mPositionEngine.addLayer( QString::number( mNumberOfLayers ).toLocal8Bit().data(), -1, -1, labelArrangement, pal::PIXEL, 0.5, true, true, true );
++mNumberOfLayers;
if ( !positionLayer )
@@ -116,8 +116,11 @@
default:
return;
}
+
mPositionEngine.setMapUnit( mapUnits );
- std::list<pal::Label*>* resultLabelList = mPositionEngine.labeller( renderContext.rendererScale(), bbox, &stat, true );
+ mPositionEngine.setDpi(renderContext.scaleFactor() * 25.4);
+
+ std::list<pal::Label*>* resultLabelList = mPositionEngine.labeller( renderContext.rendererScale(), bbox, &stat, false );
delete stat;
//and read the positions back to the overlay objects
Modified: trunk/qgis/src/plugins/diagram_overlay/qgsdiagramoverlay.cpp
===================================================================
--- trunk/qgis/src/plugins/diagram_overlay/qgsdiagramoverlay.cpp 2009-04-30 09:00:48 UTC (rev 10686)
+++ trunk/qgis/src/plugins/diagram_overlay/qgsdiagramoverlay.cpp 2009-04-30 12:52:19 UTC (rev 10687)
@@ -95,7 +95,7 @@
//error
}
- mOverlayObjects.insert( currentFeature.id(), new QgsOverlayObject( height, width, 0, currentFeature.geometryAndOwnership() ) );
+ mOverlayObjects.insert( currentFeature.id(), new QgsOverlayObject( width, height, 0, currentFeature.geometryAndOwnership() ) );
}
}
}
@@ -149,7 +149,9 @@
{
painter->save();
painter->scale( 1.0 / context.rasterScaleFactor(), 1.0 / context.rasterScaleFactor() );
+ //painter->drawRect(( int )( overlayPosition.x() * context.rasterScaleFactor() ) - shiftX, ( int )( overlayPosition.y() * context.rasterScaleFactor() ) - shiftY, it.value()->width(), it.value()->height());
painter->drawImage(( int )( overlayPosition.x() * context.rasterScaleFactor() ) - shiftX, ( int )( overlayPosition.y() * context.rasterScaleFactor() ) - shiftY, *currentDiagramImage );
+
painter->restore();
}
}
More information about the QGIS-commit
mailing list