ol 10.4.1-dev.1741685857130 → 10.4.1-dev.1741714271188
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ol.js +1 -1
- package/dist/ol.js.map +1 -1
- package/package.json +1 -1
- package/render/webgl/style.js +7 -7
- package/util.js +1 -1
package/package.json
CHANGED
package/render/webgl/style.js
CHANGED
|
@@ -615,14 +615,14 @@ function parseStrokeProperties(style, builder, uniforms, context) {
|
|
|
615
615
|
|
|
616
616
|
if ('stroke-line-dash' in style) {
|
|
617
617
|
context.functions['getSingleDashDistance'] =
|
|
618
|
-
`float getSingleDashDistance(float distance, float radius, float dashOffset, float dashLength, float dashLengthTotal, float capType) {
|
|
618
|
+
`float getSingleDashDistance(float distance, float radius, float dashOffset, float dashLength, float dashLengthTotal, float capType, float lineWidth) {
|
|
619
619
|
float localDistance = mod(distance, dashLengthTotal);
|
|
620
620
|
float distanceSegment = abs(localDistance - dashOffset - dashLength * 0.5) - dashLength * 0.5;
|
|
621
621
|
distanceSegment = min(distanceSegment, dashLengthTotal - localDistance);
|
|
622
622
|
if (capType == ${stringToGlsl('square')}) {
|
|
623
|
-
distanceSegment -=
|
|
623
|
+
distanceSegment -= lineWidth * 0.5;
|
|
624
624
|
} else if (capType == ${stringToGlsl('round')}) {
|
|
625
|
-
distanceSegment = min(distanceSegment, sqrt(distanceSegment * distanceSegment + radius * radius) -
|
|
625
|
+
distanceSegment = min(distanceSegment, sqrt(distanceSegment * distanceSegment + radius * radius) - lineWidth * 0.5);
|
|
626
626
|
}
|
|
627
627
|
return distanceSegment;
|
|
628
628
|
}`;
|
|
@@ -655,22 +655,22 @@ function parseStrokeProperties(style, builder, uniforms, context) {
|
|
|
655
655
|
.map((v, i) => `dashLength${i}`)
|
|
656
656
|
.join(' + ');
|
|
657
657
|
let currentDashOffset = '0.';
|
|
658
|
-
let distanceExpression = `getSingleDashDistance(distance, radius, ${currentDashOffset}, dashLength0, totalDashLength, capType)`;
|
|
658
|
+
let distanceExpression = `getSingleDashDistance(distance, radius, ${currentDashOffset}, dashLength0, totalDashLength, capType, lineWidth)`;
|
|
659
659
|
for (let i = 2; i < dashPattern.length; i += 2) {
|
|
660
660
|
currentDashOffset = `${currentDashOffset} + dashLength${
|
|
661
661
|
i - 2
|
|
662
662
|
} + dashLength${i - 1}`;
|
|
663
|
-
distanceExpression = `min(${distanceExpression}, getSingleDashDistance(distance, radius, ${currentDashOffset}, dashLength${i}, totalDashLength, capType))`;
|
|
663
|
+
distanceExpression = `min(${distanceExpression}, getSingleDashDistance(distance, radius, ${currentDashOffset}, dashLength${i}, totalDashLength, capType, lineWidth))`;
|
|
664
664
|
}
|
|
665
665
|
|
|
666
666
|
context.functions[dashFunctionName] =
|
|
667
|
-
`float ${dashFunctionName}(float distance, float radius, float capType) {
|
|
667
|
+
`float ${dashFunctionName}(float distance, float radius, float capType, float lineWidth) {
|
|
668
668
|
${dashLengthsDef.join('\n ')}
|
|
669
669
|
float totalDashLength = ${totalLengthDef};
|
|
670
670
|
return ${distanceExpression};
|
|
671
671
|
}`;
|
|
672
672
|
builder.setStrokeDistanceFieldExpression(
|
|
673
|
-
`${dashFunctionName}(currentLengthPx + ${offsetExpression}, currentRadiusPx, capType)`,
|
|
673
|
+
`${dashFunctionName}(currentLengthPx + ${offsetExpression}, currentRadiusPx, capType, v_width)`,
|
|
674
674
|
);
|
|
675
675
|
}
|
|
676
676
|
}
|
package/util.js
CHANGED