diff --git a/frontend/src/components/CourtDrawingRender.vue b/frontend/src/components/CourtDrawingRender.vue index c76425e..c8a6b67 100644 --- a/frontend/src/components/CourtDrawingRender.vue +++ b/frontend/src/components/CourtDrawingRender.vue @@ -65,6 +65,8 @@ export default { arrows: { primaryColor: '#d32f2f', // rechts -> target (rot) secondaryColor: '#1565c0', // zurück (blau) + tertiaryColor: '#2e7d32', // dritter Schlag (grün) + quaternaryColor: '#6a1b9a', // vierter Schlag (violett) width: 6, headLength: 24, vhOffsetX: 5, @@ -336,25 +338,39 @@ export default { const startCenter = this.getStartCircleCenter(); this.drawLabelBelow(ctx, sourceLabel, startCenter); } - - // Second arrow (optional): from right source to left target - const leftTarget = this.drawingData.nextStrokeTargetPosition ? Number(this.drawingData.nextStrokeTargetPosition) : null; - if (tp && leftTarget) { - // source near previous right target + + // Additional arrows (up to 3), alternating left/right, starting from right target + const extras = Array.isArray(this.drawingData.additionalStrokes) ? this.drawingData.additionalStrokes : []; + if (tp && extras.length) { + const colors = [ + this.config.arrows.secondaryColor, + this.config.arrows.tertiaryColor, + this.config.arrows.quaternaryColor + ]; + const max = Math.min(3, extras.length); const sourceRightCenter = this.computeRightTargetPosition(tp); - // left target mapping: mirror scheme to left half - const toLeftCenter = this.computeLeftTargetPosition(leftTarget); - // Zielmarkierung links - this.drawHitMarker(ctx, toLeftCenter); - const side = this.drawingData.nextStrokeSide || ''; - const type = this.drawingData.nextStrokeType || ''; - // Text gehört ans Ziel (ohne "extra target") - const targetLabel = `${side} ${type}`.trim(); - const sourceRight = { x: sourceRightCenter.x - this.config.targetCircles.radius, y: sourceRightCenter.y }; - const toLeft = { x: toLeftCenter.x + this.config.leftTargetCircles.radius, y: toLeftCenter.y }; - this.drawArrow(ctx, sourceRight, toLeft, this.config.arrows.secondaryColor); - // Unter dem rechten Ziel (target der ersten Linie) beschriften - this.drawLabelBelow(ctx, targetLabel, sourceRightCenter); + let prevPoint = { x: sourceRightCenter.x - this.config.targetCircles.radius, y: sourceRightCenter.y }; + for (let i = 0; i < max; i++) { + const stroke = extras[i]; + const side = i % 2 === 0 ? 'left' : 'right'; + if (side === 'left') { + const leftNum = Number(stroke.targetPosition); + const toLeftCenter = this.computeLeftTargetPosition(leftNum); + // Zielmarkierung links + this.drawHitMarker(ctx, toLeftCenter); + const toLeft = { x: toLeftCenter.x + this.config.leftTargetCircles.radius, y: toLeftCenter.y }; + this.drawArrow(ctx, prevPoint, toLeft, colors[i]); + prevPoint = toLeft; // beginnt an der Pfeilspitze des vorherigen + } else { + const rightNum = Number(stroke.targetPosition); + const toRightCenter = this.computeRightTargetPosition(rightNum); + // Zielmarkierung rechts + this.drawHitMarker(ctx, toRightCenter); + const toRight = { x: toRightCenter.x - this.config.targetCircles.radius, y: toRightCenter.y }; + this.drawArrow(ctx, prevPoint, toRight, colors[i]); + prevPoint = toRight; + } + } } }, getStartCircleCenter() { diff --git a/frontend/src/components/CourtDrawingTool.vue b/frontend/src/components/CourtDrawingTool.vue index 76273d4..62ad2d1 100644 --- a/frontend/src/components/CourtDrawingTool.vue +++ b/frontend/src/components/CourtDrawingTool.vue @@ -89,6 +89,22 @@ + +