ol 10.4.1-dev.1741685857130 → 10.4.1-dev.1741723906783

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ol",
3
- "version": "10.4.1-dev.1741685857130",
3
+ "version": "10.4.1-dev.1741723906783",
4
4
  "description": "OpenLayers mapping library",
5
5
  "keywords": [
6
6
  "map",
@@ -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 -= v_width * 0.5;
623
+ distanceSegment -= lineWidth * 0.5;
624
624
  } else if (capType == ${stringToGlsl('round')}) {
625
- distanceSegment = min(distanceSegment, sqrt(distanceSegment * distanceSegment + radius * radius) - v_width * 0.5);
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
@@ -33,4 +33,4 @@ export function getUid(obj) {
33
33
  * OpenLayers version.
34
34
  * @type {string}
35
35
  */
36
- export const VERSION = '10.4.1-dev.1741685857130';
36
+ export const VERSION = '10.4.1-dev.1741723906783';