Skip to content

Commit

Permalink
Merge pull request #12434 from mickae1/polyline
Browse files Browse the repository at this point in the history
fix bug when sinAngle is < 1. the value of expandWidth was too much:
  • Loading branch information
ggetz authored Jan 27, 2025
2 parents dc667cd + 599b1fe commit e68a5ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Fixed type of `ImageryLayer.fromProviderAsync`, to correctly show that the param `options` is optional. [#12400](https://github.com/CesiumGS/cesium/pull/12400)
- Fixed Draco decoding for vertex colors that are normalized `UNSIGNED_BYTE` or `UNSIGNED_SHORT`. [#12417](https://github.com/CesiumGS/cesium/pull/12417)
- Fixed type error when setting `Viewer.selectedEntity` [#12303](https://github.com/CesiumGS/cesium/issues/12303)
- Fixed error in polyline when sinAngle is < 1. the value of expandWidth was too much. [#12434](https://github.com/CesiumGS/cesium/pull/12434)

## 1.125 - 2025-01-02

Expand Down
2 changes: 1 addition & 1 deletion packages/engine/Source/Shaders/PolylineCommon.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, f
vec2 u = -thisSegmentForwardWC;
vec2 v = leftWC;
float sinAngle = abs(u.x * v.y - u.y * v.x);
expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);
expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 0.5);
}

vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;
Expand Down

0 comments on commit e68a5ab

Please sign in to comment.