Skip to content
Permalink
Browse files

Improved calls to PAL library

git-svn-id: http://svn.osgeo.org/qgis/trunk@10687 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Apr 30, 2009
1 parent 2d7a4f8 commit ee7bb213a49475017091fd2017cdd48f4c080693
Showing with 8 additions and 3 deletions.
  1. +5 −2 src/core/qgspalobjectpositionmanager.cpp
  2. +3 −1 src/plugins/diagram_overlay/qgsdiagramoverlay.cpp
@@ -58,7 +58,7 @@ void QgsPALObjectPositionManager::addLayer( QgsVectorLayer* vl, QList<QgsVectorO
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 @@ void QgsPALObjectPositionManager::findObjectPositions( const QgsRenderContext& r
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
@@ -95,7 +95,7 @@ void QgsDiagramOverlay::createOverlayObjects( const QgsRenderContext& renderCont
//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 @@ void QgsDiagramOverlay::drawOverlayObjects( QgsRenderContext& context ) const
{
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();
}
}

0 comments on commit ee7bb21

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