[OpenLayers-Commits] r11812 -
sandbox/tschaub/canvas/lib/OpenLayers/Renderer
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Wed Mar 30 17:53:59 EDT 2011
Author: tschaub
Date: 2011-03-30 14:53:58 -0700 (Wed, 30 Mar 2011)
New Revision: 11812
Modified:
sandbox/tschaub/canvas/lib/OpenLayers/Renderer/Canvas.js
Log:
Incorporate comment about fillOpactiy from crschmidt on #2856. Add documentation about aggressive interior ring erasing and reference the proper fix in #3130.
Modified: sandbox/tschaub/canvas/lib/OpenLayers/Renderer/Canvas.js
===================================================================
--- sandbox/tschaub/canvas/lib/OpenLayers/Renderer/Canvas.js 2011-03-30 21:49:15 UTC (rev 11811)
+++ sandbox/tschaub/canvas/lib/OpenLayers/Renderer/Canvas.js 2011-03-30 21:53:58 UTC (rev 11812)
@@ -468,13 +468,18 @@
this.drawLinearRing(components[0], style, featureId);
// erase inner rings
for (var i=1; i<len; ++i) {
- // erase inner rings
- // TODO: decide whether to erase on hit context
- // TODO: see if there is a better way to deal with overlapping polys
+ /**
+ * Note that this is overly agressive. Here we punch holes through
+ * all previously rendered features on the same canvas. A better
+ * solution for polygons with interior rings would be to draw the
+ * polygon on a sketch canvas first. We could erase all holes
+ * there and then copy the drawing to the layer canvas.
+ * TODO: http://trac.osgeo.org/openlayers/ticket/3130
+ */
this.canvas.globalCompositeOperation = "destination-out";
this.drawLinearRing(
components[i],
- OpenLayers.Util.applyDefaults({stroke: false}, style),
+ OpenLayers.Util.applyDefaults({stroke: false, fillOpacity: 1.0}, style),
featureId
);
this.canvas.globalCompositeOperation = "source-over";
More information about the Commits
mailing list