Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test updates
  • Loading branch information
nyalldawson committed Dec 26, 2019
1 parent 1899f90 commit ad825c9
Show file tree
Hide file tree
Showing 46 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/core/labeling/qgslabelingengine.cpp
Expand Up @@ -270,8 +270,8 @@ void QgsLabelingEngine::registerLabels( QgsRenderContext &context )

mPal = qgis::make_unique< pal::Pal >();

mPal->setMaximumLineCandidatesPerMapUnit( context.labelingEngine()->engineSettings().maximumLineCandidatesPerCm() / context.convertToMapUnits( 10, QgsUnitTypes::RenderMillimeters ) );
mPal->setMaximumPolygonCandidatesPerMapUnitSquared( context.labelingEngine()->engineSettings().maximumPolygonCandidatesPerCmSquared() / std::pow( context.convertToMapUnits( 10, QgsUnitTypes::RenderMillimeters ), 2 ) );
mPal->setMaximumLineCandidatesPerMapUnit( settings.maximumLineCandidatesPerCm() / context.convertToMapUnits( 10, QgsUnitTypes::RenderMillimeters ) );
mPal->setMaximumPolygonCandidatesPerMapUnitSquared( settings.maximumPolygonCandidatesPerCmSquared() / std::pow( context.convertToMapUnits( 10, QgsUnitTypes::RenderMillimeters ), 2 ) );

mPal->setShowPartialLabels( settings.testFlag( QgsLabelingEngineSettings::UsePartialCandidates ) );
mPal->setPlacementVersion( settings.placementVersion() );
Expand Down
8 changes: 2 additions & 6 deletions tests/src/python/test_qgsproject.py
Expand Up @@ -1125,7 +1125,7 @@ def testPalPropertiesReadWrite(self):
tmpFile = "{}/project.qgs".format(tmpDir.path())

s0 = QgsLabelingEngineSettings()
s0.setNumCandidatePositions(3, 33, 333)
s0.setMaximumLineCandidatesPerCm(33)

p0 = QgsProject()
p0.setFileName(tmpFile)
Expand All @@ -1136,11 +1136,7 @@ def testPalPropertiesReadWrite(self):
p1.read(tmpFile)

s1 = p1.labelingEngineSettings()
candidates = s1.numCandidatePositions()

self.assertEqual(candidates[0], 3)
self.assertEqual(candidates[1], 33)
self.assertEqual(candidates[2], 333)
self.assertEqual(s1.maximumLineCandidatesPerCm(), 33)

def testLayerChangeDirtiesProject(self):
"""
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ad825c9

Please sign in to comment.