Bug report #1313
scale indication changes in unexpected amounts on map canvas resize
|Affected QGIS version:||Regression?:||No|
|Operating System:||All||Easy fix?:||No|
|Pull Request or Patch supplied:||Resolution:||fixed|
|Crashes QGIS or corrupts data:||Copied to github as #:||11373|
When the map canvas size is changed by QGIS window being resized or splitter bar movement the indicated scale gradually decreases for a while, then jumps to a larger scale while dragging the mouse. In a somewhat similar way, decreasing the canvas width results in a scale value which stays the same for a while and then jumps to a smaller scale.
I have found that QgsScaleCalculator::calculate() uses integer divide on the canvas width, dpi values as they are both integers. This calculation should be in floating point.
The patch attached uses an explicit cast to double for both values to fix this problem.