diff --git a/plugins/plugin-annotations/src/crossbox.mjs b/plugins/plugin-annotations/src/crossbox.mjs index 1a99225e331..12fcc20d319 100644 --- a/plugins/plugin-annotations/src/crossbox.mjs +++ b/plugins/plugin-annotations/src/crossbox.mjs @@ -1,8 +1,8 @@ // Export macros export const crossboxMacros = { crossbox: function (so, { points, Point, paths, Path, getId }) { - let id = getId() - let shiftFraction = 0.1 + const id = getId() + const shiftFraction = 0.1 points[id + '_boxTopLeft'] = so.from.copy() points[id + '_boxBottomRight'] = so.to.copy() points[id + '_boxTopRight'] = new Point(so.to.x, so.from.y) @@ -44,7 +44,7 @@ export const crossboxMacros = { .line(points[id + '_topCrossBL']) .attr('class', 'lining dotted stroke-sm') if (typeof so.text === 'string') { - points.textAnchor = points[id + '_boxTopLeft'] + points[id + 'textAnchor'] = points[id + '_boxTopLeft'] .shiftFractionTowards(points[id + '_boxBottomRight'], 0.5) .attr('data-text', so.text) .attr('data-text-class', 'center') diff --git a/plugins/plugin-annotations/src/pleat.mjs b/plugins/plugin-annotations/src/pleat.mjs index 71d6105741f..5d487338bc9 100644 --- a/plugins/plugin-annotations/src/pleat.mjs +++ b/plugins/plugin-annotations/src/pleat.mjs @@ -30,8 +30,8 @@ export const pleatMacros = { ...so, } if (complete) { - points[so.prefix + 'From'] = so.from - points[so.prefix + 'To'] = so.to + points[so.prefix + 'From'] = so.from.copy() + points[so.prefix + 'To'] = so.to.copy() points[so.prefix + 'FromIn'] = points[so.prefix + 'From'].shift( so.from.shiftTowards(so.to, 0.1).angle(so.from) + 270, so.margin * scale diff --git a/plugins/plugin-annotations/src/sewtogether.mjs b/plugins/plugin-annotations/src/sewtogether.mjs index ae843816e6d..16f1570b8d8 100644 --- a/plugins/plugin-annotations/src/sewtogether.mjs +++ b/plugins/plugin-annotations/src/sewtogether.mjs @@ -45,9 +45,9 @@ export const sewtogetherMacros = { if (null == so.middle) { so.middle = so.from.shiftFractionTowards(so.to, 0.5) } - points[so.prefix + 'From'] = so.from - points[so.prefix + 'Middle'] = so.middle - points[so.prefix + 'To'] = so.to + points[so.prefix + 'From'] = so.from.copy() + points[so.prefix + 'Middle'] = so.middle.copy() + points[so.prefix + 'To'] = so.to.copy() points[so.prefix + 'FromCp'] = points[so.prefix + 'From'].shift( points[so.prefix + 'From'].angle(points[so.prefix + 'Middle']) + 90,