avoid double redraw when panning/zooming. p=tsauerwein,r=erilem (closes #2801)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10863 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -67,22 +67,6 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
|
|||||||
return !!canvas.getContext;
|
return !!canvas.getContext;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Method: setExtent
|
|
||||||
* Set the visible part of the layer.
|
|
||||||
*
|
|
||||||
* Resolution has probably changed, so we nullify the resolution
|
|
||||||
* cache (this.resolution), then redraw.
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* extent - {<OpenLayers.Bounds>}
|
|
||||||
*/
|
|
||||||
setExtent: function(extent) {
|
|
||||||
this.extent = extent.clone();
|
|
||||||
this.resolution = null;
|
|
||||||
this.redraw();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method: setSize
|
* Method: setSize
|
||||||
* Sets the size of the drawing surface.
|
* Sets the size of the drawing surface.
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
var extent = new OpenLayers.Bounds(1,2,3,4);
|
var extent = new OpenLayers.Bounds(1,2,3,4);
|
||||||
r.resolution = 1;
|
r.resolution = 1;
|
||||||
r.setExtent(extent);
|
r.setExtent(extent, true);
|
||||||
t.ok(r.extent.equals(extent), "extent is correctly set");
|
t.ok(r.extent.equals(extent), "extent is correctly set");
|
||||||
t.eq(r.resolution, null, "resolution nullified");
|
t.eq(r.resolution, null, "resolution nullified");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user