2.6 accidentally broke behavior when clicking on the panzoombar. Thanks to Linda Rawson's report of this issue, this is now fixed, by moving the Math.floor call to a different part of the code. r=euzuro (Pullup #1486)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@6799 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-04-07 04:08:33 +00:00
parent 07b72def92
commit 1b269f06f8
2 changed files with 21 additions and 5 deletions

View File

@@ -242,12 +242,11 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
var y = evt.xy.y;
var top = OpenLayers.Util.pagePosition(evt.object)[1];
var levels = (y - top)/this.zoomStopHeight;
var zoom = (this.map.getNumZoomLevels() - 1) - levels;
if(this.map.fractionalZoom) {
zoom = Math.min(Math.max(zoom, 0), this.map.getNumZoomLevels() - 1);
} else {
zoom = Math.floor(zoom);
if(!this.map.fractionalZoom) {
levels = Math.floor(levels);
}
var zoom = (this.map.getNumZoomLevels() - 1) - levels;
zoom = Math.min(Math.max(zoom, 0), this.map.getNumZoomLevels() - 1);
this.map.zoomTo(zoom);
OpenLayers.Event.stop(evt);
},