Skip to content

Commit

Permalink
Fix #437 by replacing mix() with > 0.0 check
Browse files Browse the repository at this point in the history
For reasons beyond my understanding, the `mix()` function will not work
in this situation so instead replace them with ternary `> 0.0` checks.
  • Loading branch information
jcready committed Aug 29, 2020
1 parent 0889eb1 commit 3a4d920
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions modules/layers/src/lane-layer/lane-layer.js
Expand Up @@ -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) {
Expand Down

0 comments on commit 3a4d920

Please sign in to comment.