#1313 closed bug (fixed)
scale indication changes in unexpected amounts on map canvas resize
Reported by: | smizuno | Owned by: | mhugent |
---|---|---|---|
Priority: | minor: annoyance | Milestone: | |
Component: | MapCanvas | Version: | Trunk |
Keywords: | Cc: | ||
Must Fix for Release: | No | Platform: | All |
Platform Version: | Awaiting user input: | no |
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.
Attachments (1)
Change History (4)
by , 16 years ago
Attachment: | patch_for_1313.txt added |
---|
comment:1 by , 16 years ago
Owner: | changed from | to
---|
comment:2 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Applied to svn trunk with small modification (mDpi is already double in current svn version).
Thanks! Marco
fix scale calculator