[QGIS-trac] [Quantum GIS] #1313: scale indication changes in
unexpected amounts on map canvas resize
Quantum GIS
qgis at qgis.org
Sat Sep 13 19:38:16 EDT 2008
#1313: scale indication changes in unexpected amounts on map canvas resize
-----------------------------------------------+----------------------------
Reporter: smizuno | Owner: nobody
Type: bug | Status: new
Priority: minor: annoyance or enhancement | Milestone: Version 1.0.0
Component: MapCanvas | Version: HEAD
Keywords: | Platform_version:
Platform: All | Must_fix: No
Status_info: 0 |
-----------------------------------------------+----------------------------
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.
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1313>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list