Skip to content
Permalink
Browse files

Test updates

  • Loading branch information
nyalldawson committed Dec 21, 2019
1 parent 1899f90 commit ad825c91267700bdc8c3df43b408f757fbc8820d
Showing with 4 additions and 8 deletions.
  1. +2 −2 src/core/labeling/qgslabelingengine.cpp
  2. +2 −6 tests/src/python/test_qgsproject.py
  3. BIN ...l_images/expected_pal_canvas_line/sp_curved_placement_above/{ → v1}/sp_curved_placement_above.png
  4. BIN ...ontrol_images/expected_pal_canvas_line/sp_curved_placement_above/v2/sp_curved_placement_above.png
  5. BIN ...l_images/expected_pal_canvas_line/sp_curved_placement_below/{ → v1}/sp_curved_placement_below.png
  6. BIN ...ontrol_images/expected_pal_canvas_line/sp_curved_placement_below/v2/sp_curved_placement_below.png
  7. BIN ...images/expected_pal_canvas_line/sp_curved_placement_online/{ → v1}/sp_curved_placement_online.png
  8. BIN ...trol_images/expected_pal_canvas_line/sp_curved_placement_online/v2/sp_curved_placement_online.png
  9. BIN ...ata/control_images/expected_pal_canvas_line/sp_length_expression/{ → v1}/sp_length_expression.png
  10. BIN ...testdata/control_images/expected_pal_canvas_line/sp_length_expression/v2/sp_length_expression.png
  11. BIN ...xpected_pal_composer_line/sp_img_curved_placement_above/{ → v1}/sp_img_curved_placement_above.png
  12. BIN ...ges/expected_pal_composer_line/sp_img_curved_placement_above/v2/sp_img_curved_placement_above.png
  13. BIN ...xpected_pal_composer_line/sp_img_curved_placement_below/{ → v1}/sp_img_curved_placement_below.png
  14. BIN ...ges/expected_pal_composer_line/sp_img_curved_placement_below/v2/sp_img_curved_placement_below.png
  15. BIN ...ected_pal_composer_line/sp_img_curved_placement_online/{ → v1}/sp_img_curved_placement_online.png
  16. BIN ...s/expected_pal_composer_line/sp_img_curved_placement_online/v2/sp_img_curved_placement_online.png
  17. BIN ...l_images/expected_pal_composer_line/sp_img_length_expression/{ → v1}/sp_img_length_expression.png
  18. BIN ...ontrol_images/expected_pal_composer_line/sp_img_length_expression/v2/sp_img_length_expression.png
  19. BIN ...xpected_pal_composer_line/sp_pdf_curved_placement_above/{ → v1}/sp_pdf_curved_placement_above.png
  20. BIN ...ges/expected_pal_composer_line/sp_pdf_curved_placement_above/v2/sp_pdf_curved_placement_above.png
  21. BIN ...xpected_pal_composer_line/sp_pdf_curved_placement_below/{ → v1}/sp_pdf_curved_placement_below.png
  22. BIN ...ges/expected_pal_composer_line/sp_pdf_curved_placement_below/v2/sp_pdf_curved_placement_below.png
  23. BIN ...ected_pal_composer_line/sp_pdf_curved_placement_online/{ → v1}/sp_pdf_curved_placement_online.png
  24. BIN ...s/expected_pal_composer_line/sp_pdf_curved_placement_online/v2/sp_pdf_curved_placement_online.png
  25. BIN ...l_images/expected_pal_composer_line/sp_pdf_length_expression/{ → v1}/sp_pdf_length_expression.png
  26. BIN ...ontrol_images/expected_pal_composer_line/sp_pdf_length_expression/v2/sp_pdf_length_expression.png
  27. BIN ...xpected_pal_composer_line/sp_svg_curved_placement_above/{ → v1}/sp_svg_curved_placement_above.png
  28. BIN ...ges/expected_pal_composer_line/sp_svg_curved_placement_above/v2/sp_svg_curved_placement_above.png
  29. BIN ...xpected_pal_composer_line/sp_svg_curved_placement_below/{ → v1}/sp_svg_curved_placement_below.png
  30. BIN ...ges/expected_pal_composer_line/sp_svg_curved_placement_below/v2/sp_svg_curved_placement_below.png
  31. BIN ...ected_pal_composer_line/sp_svg_curved_placement_online/{ → v1}/sp_svg_curved_placement_online.png
  32. BIN ...s/expected_pal_composer_line/sp_svg_curved_placement_online/v2/sp_svg_curved_placement_online.png
  33. BIN ...l_images/expected_pal_composer_line/sp_svg_length_expression/{ → v1}/sp_svg_length_expression.png
  34. BIN ...ontrol_images/expected_pal_composer_line/sp_svg_length_expression/v2/sp_svg_length_expression.png
  35. BIN ...s/expected_pal_placement/sp_label_curved_zero_width_char/sp_label_curved_zero_width_char_mask.png
  36. BIN ...ol_images/expected_pal_placement/sp_label_line_toward_center/sp_label_line_toward_center_mask.png
  37. BIN ...nt/sp_line_line_obstacle_obstacle_factor_less/sp_line_line_obstacle_obstacle_factor_less_mask.png
  38. BIN .../sp_line_point_obstacle_obstacle_factor_less/sp_line_point_obstacle_obstacle_factor_less_mask.png
  39. BIN ...line_polygon_obstacle_obstacle_factor_less/sp_line_polygon_obstacle_obstacle_factor_less_mask.png
  40. BIN ...pected_pal_placement/sp_polygon_placement_perimeter/below/sp_polygon_placement_perimeter_mask.png
  41. BIN ...p_prefer_line_curved_above_instead_of_below/sp_prefer_line_curved_above_instead_of_below_mask.png
  42. BIN ...prefer_line_curved_above_instead_of_online/sp_prefer_line_curved_above_instead_of_online_mask.png
  43. BIN ...prefer_line_curved_below_instead_of_online/sp_prefer_line_curved_below_instead_of_online_mask.png
  44. BIN ...ed_pal_placement/sp_prefer_longer_lines_over_shorter/sp_prefer_longer_lines_over_shorter_mask.png
  45. BIN ...s/expected_pal_placement/sp_prefer_more_horizontal_lines/sp_prefer_more_horizontal_lines_mask.png
  46. BIN ..._pal_placement/sp_small_polygon_placement_perimeter/sp_small_polygon_placement_perimeter_mask.png
@@ -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() );
@@ -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)
@@ -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):
"""
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.

0 comments on commit ad825c9

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