From d07420f33c5f68cd210e0f3f4578228ac050a063 Mon Sep 17 00:00:00 2001 From: Dan Bagnell Date: Thu, 4 May 2017 15:12:15 -0400 Subject: [PATCH] Fix polyline distance display condition bug. --- Source/Scene/PolylineCollection.js | 10 +++++----- Source/Shaders/PolylineVS.glsl | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/Scene/PolylineCollection.js b/Source/Scene/PolylineCollection.js index 4d491863be01..815f95d93dc7 100644 --- a/Source/Scene/PolylineCollection.js +++ b/Source/Scene/PolylineCollection.js @@ -244,7 +244,7 @@ define([ Cesium.Cartographic.fromDegrees(-77.02, 38.53)]), * width : 1 * }); - * + * * @see PolylineCollection#remove * @see PolylineCollection#removeAll * @see PolylineCollection#update @@ -276,7 +276,7 @@ define([ * @example * var p = polylines.add(...); * polylines.remove(p); // Returns true - * + * * @see PolylineCollection#add * @see PolylineCollection#removeAll * @see PolylineCollection#update @@ -313,7 +313,7 @@ define([ * polylines.add(...); * polylines.add(...); * polylines.removeAll(); - * + * * @see PolylineCollection#add * @see PolylineCollection#remove * @see PolylineCollection#update @@ -502,7 +502,7 @@ define([ var distanceDisplayCondition = polyline.distanceDisplayCondition; if (defined(distanceDisplayCondition)) { nearFarCartesian.x = distanceDisplayCondition.near; - nearFarCartesian.x = distanceDisplayCondition.far; + nearFarCartesian.y = distanceDisplayCondition.far; } this._batchTable.setBatchedAttribute(polyline._index, 4, nearFarCartesian); @@ -735,7 +735,7 @@ define([ * * @example * polylines = polylines && polylines.destroy(); - * + * * @see PolylineCollection#isDestroyed */ PolylineCollection.prototype.destroy = function() { diff --git a/Source/Shaders/PolylineVS.glsl b/Source/Shaders/PolylineVS.glsl index 6b72184c19a2..49282da2fefd 100644 --- a/Source/Shaders/PolylineVS.glsl +++ b/Source/Shaders/PolylineVS.glsl @@ -16,7 +16,7 @@ varying vec2 v_st; varying float v_width; varying vec4 czm_pickColor; -void main() +void main() { float texCoord = texCoordExpandAndBatchIndex.x; float expandDir = texCoordExpandAndBatchIndex.y; @@ -33,7 +33,7 @@ void main() } vec4 pickColor = batchTable_getPickColor(batchTableIndex); - + vec4 p, prev, next; if (czm_morphTime == 1.0) { @@ -88,10 +88,10 @@ void main() show = 0.0; } #endif - + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev); gl_Position = czm_viewportOrthographic * positionWC * show; - + v_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0)); v_width = width; czm_pickColor = pickColor;