From 3a4d9207b4ac7af2406e652f896d691da54080c0 Mon Sep 17 00:00:00 2001 From: James Wyatt Cready-Pyle Date: Sat, 29 Aug 2020 12:05:47 -0400 Subject: [PATCH] Fix #437 by replacing mix() with > 0.0 check For reasons beyond my understanding, the `mix()` function will not work in this situation so instead replace them with ternary `> 0.0` checks. --- modules/layers/src/lane-layer/lane-layer.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/layers/src/lane-layer/lane-layer.js b/modules/layers/src/lane-layer/lane-layer.js index c85a394c..2db46043 100644 --- a/modules/layers/src/lane-layer/lane-layer.js +++ b/modules/layers/src/lane-layer/lane-layer.js @@ -104,13 +104,11 @@ float round(float x) { float unitLength = solid2 + vDashArray.w; if (unitLength > 0.0 && vDashArray.y > 0.0) { - unitLength = mix( - unitLength, - vPathLength / round(vPathLength / unitLength), - dashAlignMode - ); + unitLength = dashAlignMode > 0.0 + ? vPathLength / round(vPathLength / unitLength) + : unitLength; - float offset = mix(vPathOffset, vDashArray.x / 2.0, dashAlignMode); + float offset = dashAlignMode > 0.0 ? vDashArray.x / 2.0 : vPathOffset; float unitPosition = mod2(vPathPosition.y + offset, unitLength); if (unitPosition > solid1 && unitPosition < gap1 || unitPosition > solid2) {