Skip to content

Commit 4569df6

Browse files
committed
Website updates
1 parent 07cb8d5 commit 4569df6

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

dist/en/main/examples/common.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/common.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/render/webgl/style.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,9 @@ function parseStrokeProperties(style, builder, uniforms, context) {
648648
const uniqueDashKey = computeHash(style['stroke-line-dash']);
649649
const dashFunctionName = `dashDistanceField_${uniqueDashKey}`;
650650

651-
const dashLengthsDef = dashPattern.map(
652-
(v, i) => `float dashLength${i} = ${v};`,
653-
);
651+
const dashLengthsParamsDef = dashPattern
652+
.map((v, i) => `float dashLength${i}`)
653+
.join(', ');
654654
const totalLengthDef = dashPattern
655655
.map((v, i) => `dashLength${i}`)
656656
.join(' + ');
@@ -664,13 +664,13 @@ function parseStrokeProperties(style, builder, uniforms, context) {
664664
}
665665

666666
context.functions[dashFunctionName] =
667-
`float ${dashFunctionName}(float distance, float radius, float capType, float lineWidth) {
668-
${dashLengthsDef.join('\n ')}
667+
`float ${dashFunctionName}(float distance, float radius, float capType, float lineWidth, ${dashLengthsParamsDef}) {
669668
float totalDashLength = ${totalLengthDef};
670669
return ${distanceExpression};
671670
}`;
671+
const dashLengthsCalls = dashPattern.map((v, i) => `${v}`).join(', ');
672672
builder.setStrokeDistanceFieldExpression(
673-
`${dashFunctionName}(currentLengthPx + ${offsetExpression}, currentRadiusPx, capType, v_width)`,
673+
`${dashFunctionName}(currentLengthPx + ${offsetExpression}, currentRadiusPx, capType, v_width, ${dashLengthsCalls})`,
674674
);
675675
}
676676
}

0 commit comments

Comments
 (0)