Skip to content

Commit 099b0d6

Browse files
Copilotgatopeich
andcommitted
Check if symbol is function before calling symbolNumber() in backoff calculation
Co-authored-by: gatopeich <7722268+gatopeich@users.noreply.github.com>
1 parent 86086e0 commit 099b0d6

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/components/drawing/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,12 @@ function applyBackoff(pt, start) {
15061506
var endMarkerSize = endMarker.size;
15071507
if (Lib.isArrayOrTypedArray(endMarkerSize)) endMarkerSize = endMarkerSize[endI];
15081508

1509-
b = endMarker ? (drawing.symbolBackOffs[drawing.symbolNumber(endMarkerSymbol)] || 0) * endMarkerSize : 0;
1509+
// Custom functions don't have backoff values, only built-in symbols do
1510+
var backoffValue = 0;
1511+
if (endMarker && typeof endMarkerSymbol !== 'function') {
1512+
backoffValue = drawing.symbolBackOffs[drawing.symbolNumber(endMarkerSymbol)] || 0;
1513+
}
1514+
b = backoffValue * endMarkerSize;
15101515
b += drawing.getMarkerStandoff(d[endI], trace) || 0;
15111516
}
15121517

0 commit comments

Comments
 (0)