qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.37k stars 2.98k forks source link

Fit Segment Width Scalebar does not update when adding segments #49095

Open baswein opened 2 years ago

baswein commented 2 years ago

What is the bug or the crash?

If you add or subtract segments with Fit Segment Width set in the scalebar settings the scalebar length does not recalculate. In order to get the scalebar to recalculate you need to either change the scale of the linked map or edit the upper or lower range of the Fit. Here i a GIF showing how it is working: fixed segment width

My assumptions here are that the length of the scalebar (all the segments) should be recalculated to be between the upper and lower range of the mm set in the 2 boxes but the text in the dialog and in the documentation is confusing if that is how it is supposed to work.

With that assumption the radio button should probably read Fit segments between or Fit between instead of Fit segment width. Also minimum scalebar length and maximum scalebar length would be useful as hint text.

QGIS rocks!

Steps to reproduce the issue

Open map > add layout> add map > add scalebar > set to Fit segment width > change number of segments: Scalebar length does not update.

I tried this on the master and on 3.24.

Versions

QGIS version | 3.25.0-Master | QGIS code revision | d088b5eade -- | -- | -- | -- Qt version | 5.15.3 Python version | 3.9.5 Compiled against GDAL/OGR | 3.6.0dev-07147d9495 | Running against GDAL/OGR | 3.6.0dev-4723b818c2 PROJ version | 9.0.0 EPSG Registry database version | v10.054 (2022-02-13) GEOS version | 3.10.2-CAPI-1.16.0 SQLite version | 3.38.1 PDAL version | 2.3.0 PostgreSQL client version | unknown SpatiaLite version | 5.0.1 QWT version | 6.1.6 QScintilla2 version | 2.13.1 OS version | Windows 10 Version 2009   |   |   |   This copy of QGIS writes debugging output.   |   |   |   Active Python plugins db_manager | 0.1.20 grassprovider | 2.12.99 MetaSearch | 0.3.6 processing | 2.12.99 sagaprovider | 2.12.99 QGIS version 3.25.0-Master QGIS code revision [d088b5eade](https://github.com/qgis/QGIS/commit/d088b5eade) Qt version 5.15.3 Python version 3.9.5 Compiled against GDAL/OGR 3.6.0dev-07147d9495 Running against GDAL/OGR 3.6.0dev-4723b818c2 PROJ version 9.0.0 EPSG Registry database version v10.054 (2022-02-13) GEOS version 3.10.2-CAPI-1.16.0 SQLite version 3.38.1 PDAL version 2.3.0 PostgreSQL client version unknown SpatiaLite version 5.0.1 QWT version 6.1.6 QScintilla2 version 2.13.1 OS version Windows 10 Version 2009 This copy of QGIS writes debugging output. Active Python plugins db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.6 processing 2.12.99 sagaprovider 2.12.99 ### Supported QGIS version - [X] I'm running a supported QGIS version according to the roadmap. ### New profile - [X] I tried with a new QGIS profile ### Additional context _No response_
DelazJ commented 2 years ago

@baswein here the PR that introduced the feature and from what I can understand (don't blindly trust me, that said) there (and i think i had experienced in the past) the value you enter represents the min and max length of the whole scale bar: https://github.com/qgis/QGIS/pull/2031/files#diff-71ea7c82f8f1d74ecf42c49a946ebbd18a173b0a72c0f133df75ae9b7f7a29b5R260

baswein commented 2 years ago

Thanks @DelazJ - the text in the code seems to indicate that as well. So maybe it should read Fit scale bar between. Or:

Fit segments within