Bug report #1313

scale indication changes in unexpected amounts on map canvas resize

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

Status:Closed
Priority:Low
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

Description

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

History

#1 Updated by Marco Hugentobler over 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).

Thanks!
Marco

#2 Updated by Anonymous over 15 years ago

Milestone Version 1.0.0 deleted

Also available in: Atom PDF