Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RenderUnit::RenderMetersInMapUnits: no preview Image in Symbology-Dialog #24765

Closed
qgib opened this issue Jul 14, 2017 · 3 comments
Closed

RenderUnit::RenderMetersInMapUnits: no preview Image in Symbology-Dialog #24765

qgib opened this issue Jul 14, 2017 · 3 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers GUI/UX Related to QGIS application GUI or User Experience

Comments

@qgib
Copy link
Contributor

qgib commented Jul 14, 2017

Author Name: Mark Johnson (Mark Johnson)
Original Redmine Issue: 16866
Affected QGIS version: master
Redmine category:gui


For the implementation of RenderMetersInMapUnits, one aspect has been overlooked:

  • the preview Image in the Symbology-Dialog remains blank when RenderMetersInMapUnits is active

Otherwise everything seems to work as expected.

For the 'designing' if the Symbol to be shown this should be considered important.

I assume that something similar must be done as in QgsRenderContext::convertToMapUnits

  • where in the case statement RenderMetersInMapUnits must be added before QgsUnitTypes::RenderMapUnits with a FALLTHROUGH;

!MetersInMapUnits.Scale_050.png!


@qgib
Copy link
Contributor Author

qgib commented Jul 15, 2017

Author Name: Mark Johnson (Mark Johnson)


This problem seems to be caused by a (possibly) logical error in QgsSymbol::bigSymbolPreviewImage

The QgsUnitTypes::RenderUnit of the Layer is being used instead of QgsUnitTypes::RenderMillimeters.

!updatePreview.all.Original.png!

The QgsDistanceArea being used is not based on the Layer being used.

Thus when this runs, MapUnits are assumed to be in Degrees, RenderMetersInMapUnits (a value given in Meters) is transformed into degrees. So for the given 5.1 Meters: 0.00000458141 is bing used - which cannot be seen.

This seems to also to effect Icons being shown for the 'Simple marker' and in the Layer Panel.

For QgsSymbol::bigSymbolPreviewImage, this is simple to resolve

  • save the OutputUnit of the class (which renderPolyline, renderPolygon and renderPoint use)
  • setOutputUnit( QgsUnitTypes::RenderMillimeters);
  • restore the original value of the OutputUnit.

I was hoping to do the same for QgsSymbol::drawPreviewIcon, but that did not work.

  • so this problem is still open.

A pull request is being made for the first solution with a reference to this issue.


  • 11180 was configured as updatePreview.all.Original.png

@qgib
Copy link
Contributor Author

qgib commented Mar 9, 2019

Author Name: Giovanni Manghi (@gioman)


Please check if this issue is still valid on QGIS 3.4.5 or 3.6.


  • status_id was changed from Open to Feedback

@qgib qgib added Feedback Waiting on the submitter for answers Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority GUI/UX Related to QGIS application GUI or User Experience labels May 25, 2019
@gioman
Copy link
Contributor

gioman commented Jun 4, 2021

Closing for lack of feedback.

@gioman gioman closed this as completed Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers GUI/UX Related to QGIS application GUI or User Experience
Projects
None yet
Development

No branches or pull requests

2 participants