Bug report #11181
scaling range for line widths not persistent
|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|
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"/>
#2 Updated by Kai Borgolte about 6 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.