Bug report #1313

scale indication changes in unexpected amounts on map canvas resize

Added by Steven Mizuno almost 16 years ago. Updated almost 15 years ago.

Assignee:Marco Hugentobler
Category:Map Canvas
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.

patch_for_1313.txt Magnifier - fix scale calculator (514 Bytes) Steven Mizuno, 2008-09-13 04:39 PM


#1 Updated by Marco Hugentobler almost 16 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Applied to svn trunk with small modification (mDpi is already double in current svn version).


#2 Updated by Anonymous almost 15 years ago

Milestone Version 1.0.0 deleted

Also available in: Atom PDF