[OpenLayers-Commits] r11949 - in trunk/openlayers:
lib/OpenLayers/Renderer tests/Renderer
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Wed May 4 08:08:29 EDT 2011
Author: bbinet
Date: 2011-05-04 05:08:25 -0700 (Wed, 04 May 2011)
New Revision: 11949
Modified:
trunk/openlayers/lib/OpenLayers/Renderer/Canvas.js
trunk/openlayers/tests/Renderer/Canvas.html
Log:
fix regression introduced in [11881]: redraw is needed for unrendered features to be properly cleared. r=erilem (closes #3224)
Modified: trunk/openlayers/lib/OpenLayers/Renderer/Canvas.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Renderer/Canvas.js 2011-05-04 10:37:09 UTC (rev 11948)
+++ trunk/openlayers/lib/OpenLayers/Renderer/Canvas.js 2011-05-04 12:08:25 UTC (rev 11949)
@@ -145,8 +145,12 @@
if (rendered) {
// keep track of what we have rendered for redraw
this.features[feature.id] = [feature, style];
- this.pendingRedraw = true;
}
+ else {
+ // remove from features tracked for redraw
+ delete(this.features[feature.id]);
+ }
+ this.pendingRedraw = true;
}
if (this.pendingRedraw && !this.locked) {
this.redraw();
Modified: trunk/openlayers/tests/Renderer/Canvas.html
===================================================================
--- trunk/openlayers/tests/Renderer/Canvas.html 2011-05-04 10:37:09 UTC (rev 11948)
+++ trunk/openlayers/tests/Renderer/Canvas.html 2011-05-04 12:08:25 UTC (rev 11949)
@@ -171,7 +171,7 @@
{display: "none"}
);
t.eq(exp, false, "c) drawFeature returns false");
- t.eq(count, 0, "c) redraw is not called when drawing a feature with display 'none'");
+ t.eq(count, 1, "c) redraw is called when drawing a feature with display 'none'");
renderer.clear();
// d) draw a point feature outside renderer extent
@@ -180,7 +180,7 @@
new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(-1000, 0)), {}
);
t.eq(exp, false, "d) drawFeature returns false");
- t.eq(count, 0, "d) redraw is not called when drawing a feature outside renderer extent");
+ t.eq(count, 1, "d) redraw is called when drawing a feature outside renderer extent");
renderer.clear();
map.destroy();
More information about the Commits
mailing list