Minor fixes according to review
This commit is contained in:
@@ -164,7 +164,7 @@ ol.render.webgl.CircleReplay.prototype.finish = function(context) {
|
||||
*/
|
||||
ol.render.webgl.CircleReplay.prototype.getDeleteResourcesFunction = function(context) {
|
||||
// We only delete our stuff here. The shaders and the program may
|
||||
// be used by other PolygonReplay instances (for other layers). And
|
||||
// be used by other CircleReplay instances (for other layers). And
|
||||
// they will be deleted when disposing of the ol.webgl.Context
|
||||
// object.
|
||||
ol.DEBUG && console.assert(this.verticesBuffer,
|
||||
|
||||
@@ -61,7 +61,7 @@ ol.render.webgl.lineStringInstruction = {
|
||||
};
|
||||
|
||||
/**
|
||||
* Calcualtes the orientation of a triangle based on the determinant method.
|
||||
* Calculates the orientation of a triangle based on the determinant method.
|
||||
* @param {number} x1 First X coordinate.
|
||||
* @param {number} y1 First Y coordinate.
|
||||
* @param {number} x2 Second X coordinate.
|
||||
|
||||
@@ -150,6 +150,7 @@ ol.render.webgl.LineStringReplay.prototype.drawCoordinates_ = function(flatCoord
|
||||
break;
|
||||
} else {
|
||||
//For the compiler not to complain. This will never be [0, 0].
|
||||
ol.DEBUG && console.assert(p0, 'p0 should be defined');
|
||||
p0 = p0 || [0, 0];
|
||||
|
||||
numVertices = this.addVertices_(p0, p1, [0, 0],
|
||||
@@ -189,6 +190,7 @@ ol.render.webgl.LineStringReplay.prototype.drawCoordinates_ = function(flatCoord
|
||||
p2 = [flatCoordinates[i + stride], flatCoordinates[i + stride + 1]];
|
||||
}
|
||||
|
||||
// We group CW and straight lines, thus the not so inituitive CCW checking function.
|
||||
sign = ol.render.webgl.triangleIsCounterClockwise(p0[0], p0[1], p1[0], p1[1], p2[0], p2[1])
|
||||
? -1 : 1;
|
||||
|
||||
@@ -232,6 +234,7 @@ ol.render.webgl.LineStringReplay.prototype.drawCoordinates_ = function(flatCoord
|
||||
if (closed) {
|
||||
//Link the last triangle/rhombus to the first one.
|
||||
//n will never be numVertices / 7 here. However, the compiler complains otherwise.
|
||||
ol.DEBUG && console.assert(n, 'n should be defined');
|
||||
n = n || numVertices / 7;
|
||||
sign = ol.geom.flat.orient.linearRingIsClockwise([p0[0], p0[1], p1[0], p1[1], p2[0], p2[1]], 0, 6, 2)
|
||||
? 1 : -1;
|
||||
|
||||
@@ -297,6 +297,7 @@ ol.render.webgl.PolygonReplay.prototype.triangulate_ = function(list, rtree) {
|
||||
// introduce touching segments. However, the original data may have some.
|
||||
if (!this.resolveLocalSelfIntersections_(list, rtree, true)) {
|
||||
// Something went wrong.
|
||||
ol.DEBUG && console.assert(false, 'Unexpected simple polygon geometry');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ goog.provide('ol.structs.LinkedList');
|
||||
* Creates an empty linked list structure.
|
||||
*
|
||||
* @constructor
|
||||
* @struct
|
||||
* @param {boolean=} opt_circular The last item is connected to the first one,
|
||||
* and the first item to the last one. Default is true.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user