Bug report #11181

scaling range for line widths not persistent

Added by Kai Borgolte about 10 years ago. Updated almost 10 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Symbology
Affected QGIS version:2.4.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:19494

Description

I style a line layer, giving the line width in map units, and defining min and/or max scales (button near the words "map unit"). When I save the project or the style, the values are saved. When I re-open the project, min and max scales are not applied anymore, and when I save the project again, they are lost.

Attached are sample project files after first saving and after loading and saving again that project file. The offending line is line 88:
<prop k="width_map_unit_scale" v="0.001,0.01"/>
that is: scale in range 1 : 100 to 1 : 1000, which degenerates to
<prop k="width_map_unit_scale" v="0,0"/>

bug1.qgs - after first save (17.8 KB) Kai Borgolte, 2014-09-10 07:13 AM

bug2.qgs - after open and save again (17.8 KB) Kai Borgolte, 2014-09-10 07:13 AM

Associated revisions

Revision 9d30db43
Added by Nyall Dawson almost 10 years ago

Fix map unit scale for simple line width not restored (fix #11181)

Revision 4473efe3
Added by Nyall Dawson almost 10 years ago

Fix map unit scale for simple line width not restored (fix #11181)

History

#1 Updated by Kai Borgolte about 10 years ago

Same issue with QGIS weekly (2.5.0-Master code revision 4291337).

#2 Updated by Kai Borgolte about 10 years ago

I think I narrowed the problem to the source file
[[https://github.com/qgis/QGIS/blob/master/src/core/symbology-ng/qgslinesymbollayerv2.cpp]], but I am not able to test it myself:

In QgsSimpleLineSymbolLayerV2::create() the property width_map_unit_scale is not handled. This should be a one-liner.

Looking at QgsSimpleLineSymbolLayerV2::setMapUnitScale(), QgsLineSymbolLayerV2::setMapUnitScale() (in [[https://github.com/qgis/QGIS/blob/master/src/core/symbology-ng/qgssymbollayerv2.cpp]]) and QgsLineSymbolLayerV2::setWidthMapUnitScale() (in [[https://github.com/qgis/QGIS/blob/master/src/core/symbology-ng/qgssymbollayerv2.h]]), I don't think it will be necessary to implement QgsSimpleLineSymbolLayerV2::setWidthMapUnitScale().

Please someone fix this. I hope my research does help.

#3 Updated by Jürgen Fischer almost 10 years ago

  • Category set to Symbology

#4 Updated by Nyall Dawson almost 10 years ago

  • Status changed from Open to Closed

#5 Updated by Kai Borgolte almost 10 years ago

Thank you very much!

Also available in: Atom PDF