Minor fixes according to review

This commit is contained in:
GaborFarkas
2016-11-14 17:35:26 +01:00
parent dd905ffb5b
commit efbc4ead8d
5 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ ol.render.webgl.CircleReplay.prototype.finish = function(context) {
*/ */
ol.render.webgl.CircleReplay.prototype.getDeleteResourcesFunction = function(context) { ol.render.webgl.CircleReplay.prototype.getDeleteResourcesFunction = function(context) {
// We only delete our stuff here. The shaders and the program may // 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 // they will be deleted when disposing of the ol.webgl.Context
// object. // object.
ol.DEBUG && console.assert(this.verticesBuffer, ol.DEBUG && console.assert(this.verticesBuffer,
+1 -1
View File
@@ -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} x1 First X coordinate.
* @param {number} y1 First Y coordinate. * @param {number} y1 First Y coordinate.
* @param {number} x2 Second X coordinate. * @param {number} x2 Second X coordinate.
@@ -150,6 +150,7 @@ ol.render.webgl.LineStringReplay.prototype.drawCoordinates_ = function(flatCoord
break; break;
} else { } else {
//For the compiler not to complain. This will never be [0, 0]. //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]; p0 = p0 || [0, 0];
numVertices = this.addVertices_(p0, p1, [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]]; 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]) sign = ol.render.webgl.triangleIsCounterClockwise(p0[0], p0[1], p1[0], p1[1], p2[0], p2[1])
? -1 : 1; ? -1 : 1;
@@ -232,6 +234,7 @@ ol.render.webgl.LineStringReplay.prototype.drawCoordinates_ = function(flatCoord
if (closed) { if (closed) {
//Link the last triangle/rhombus to the first one. //Link the last triangle/rhombus to the first one.
//n will never be numVertices / 7 here. However, the compiler complains otherwise. //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; 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) sign = ol.geom.flat.orient.linearRingIsClockwise([p0[0], p0[1], p1[0], p1[1], p2[0], p2[1]], 0, 6, 2)
? 1 : -1; ? 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. // introduce touching segments. However, the original data may have some.
if (!this.resolveLocalSelfIntersections_(list, rtree, true)) { if (!this.resolveLocalSelfIntersections_(list, rtree, true)) {
// Something went wrong. // Something went wrong.
ol.DEBUG && console.assert(false, 'Unexpected simple polygon geometry');
break; break;
} }
} }
+1
View File
@@ -4,6 +4,7 @@ goog.provide('ol.structs.LinkedList');
* Creates an empty linked list structure. * Creates an empty linked list structure.
* *
* @constructor * @constructor
* @struct
* @param {boolean=} opt_circular The last item is connected to the first one, * @param {boolean=} opt_circular The last item is connected to the first one,
* and the first item to the last one. Default is true. * and the first item to the last one. Default is true.
*/ */