Use oriented rings where needed

This commit is contained in:
Tom Payne
2014-01-21 07:49:01 +01:00
parent 5b5865d48e
commit 6552046aa0
2 changed files with 4 additions and 4 deletions

View File

@@ -104,7 +104,7 @@ ol.geom.Polygon.prototype.closestPointXY =
*/ */
ol.geom.Polygon.prototype.containsXY = function(x, y) { ol.geom.Polygon.prototype.containsXY = function(x, y) {
return ol.geom.flat.linearRingsContainsXY( return ol.geom.flat.linearRingsContainsXY(
this.flatCoordinates, 0, this.ends_, this.stride, x, y); this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, x, y);
}; };
@@ -113,7 +113,7 @@ ol.geom.Polygon.prototype.containsXY = function(x, y) {
*/ */
ol.geom.Polygon.prototype.getArea = function() { ol.geom.Polygon.prototype.getArea = function() {
return ol.geom.flat.linearRingsArea( return ol.geom.flat.linearRingsArea(
this.flatCoordinates, 0, this.ends_, this.stride); this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride);
}; };
@@ -142,7 +142,7 @@ ol.geom.Polygon.prototype.getInteriorPoint = function() {
var extent = this.getExtent(); var extent = this.getExtent();
var y = (extent[1] + extent[3]) / 2; var y = (extent[1] + extent[3]) / 2;
this.interiorPoint_ = ol.geom.flat.linearRingsGetInteriorPoint( this.interiorPoint_ = ol.geom.flat.linearRingsGetInteriorPoint(
this.flatCoordinates, 0, this.ends_, this.stride, y); this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, y);
this.interiorPointRevision_ = this.getRevision(); this.interiorPointRevision_ = this.getRevision();
} }
return this.interiorPoint_; return this.interiorPoint_;

View File

@@ -1096,7 +1096,7 @@ ol.render.canvas.PolygonReplay.prototype.drawPolygonGeometry =
state.miterLimit, state.lineDash]); state.miterLimit, state.lineDash]);
} }
var ends = polygonGeometry.getEnds(); var ends = polygonGeometry.getEnds();
var flatCoordinates = polygonGeometry.getFlatCoordinates(); var flatCoordinates = polygonGeometry.getOrientedFlatCoordinates();
var stride = polygonGeometry.getStride(); var stride = polygonGeometry.getStride();
this.drawFlatCoordinatess_(flatCoordinates, 0, ends, stride); this.drawFlatCoordinatess_(flatCoordinates, 0, ends, stride);
this.endGeometry(polygonGeometry, data); this.endGeometry(polygonGeometry, data);