feat: Circle/RoundedRectangle-Zeichenbefehle im Canvas-Backend, Fehlzeitenkalender-Kacheln größer
CI / build-and-test (push) Waiting to run

Neue DrawingCommand-Primitives DrawCircle und DrawRoundedRectangle (SVG-Rendering
plus FLOWDRAWBOX-Paginierung). Anwesenheitskalender nutzt RoundedRectangle für die
Tageskacheln und verkleinert Monatsabstand/Kachel-Innenabstand, damit die Kacheln
den Rasterplatz sichtbar besser ausfüllen.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-17 13:59:08 +02:00
co-authored by Claude Sonnet 5
parent 77fe9b1c79
commit 763d7744be
4 changed files with 42 additions and 5 deletions
+18 -2
View File
@@ -577,15 +577,18 @@ internal static class DrawingElementRenderer
private static float? CommandY(DrawingCommand command) => command switch
{
DrawString s => s.Y, DrawStringEx s => s.Y, MoveTo m => m.Y, LineTo l => l.Y,
DrawRectangle r => r.Y, DrawImage i => i.Y, DrawLine ln => Math.Min(ln.Y1, ln.Y2), _ => null,
DrawRectangle r => r.Y, DrawRoundedRectangle r => r.Y, DrawImage i => i.Y,
DrawLine ln => Math.Min(ln.Y1, ln.Y2), DrawCircle c => c.CenterY - c.Radius, _ => null,
};
private static DrawingCommand ShiftY(DrawingCommand command, float dy) => command switch
{
DrawString s => s with { Y = s.Y - dy }, DrawStringEx s => s with { Y = s.Y - dy },
MoveTo m => m with { Y = m.Y - dy }, LineTo l => l with { Y = l.Y - dy },
DrawRectangle r => r with { Y = r.Y - dy }, DrawImage i => i with { Y = i.Y - dy },
DrawRectangle r => r with { Y = r.Y - dy }, DrawRoundedRectangle r => r with { Y = r.Y - dy },
DrawImage i => i with { Y = i.Y - dy },
DrawLine ln => ln with { Y1 = ln.Y1 - dy, Y2 = ln.Y2 - dy },
DrawCircle c => c with { CenterY = c.CenterY - dy },
_ => command,
};
@@ -649,6 +652,19 @@ internal static class DrawingElementRenderer
svg.Append(CultureInfo.InvariantCulture,
$"<rect x=\"{rectangle.X}\" y=\"{rectangle.Y}\" width=\"{rectangle.Width}\" height=\"{rectangle.Height}\" stroke=\"{Attribute(rectangle.StrokeColor)}\" stroke-width=\"{rectangle.StrokeWidth}\" fill=\"{Attribute(rectangle.FillColor)}\"/>");
break;
case DrawRoundedRectangle rectangle:
Validate(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, rectangle.CornerRadius,
rectangle.StrokeWidth);
Positive(rectangle.Width, rectangle.Height, rectangle.CornerRadius, rectangle.StrokeWidth);
svg.Append(CultureInfo.InvariantCulture,
$"<rect x=\"{rectangle.X}\" y=\"{rectangle.Y}\" width=\"{rectangle.Width}\" height=\"{rectangle.Height}\" rx=\"{rectangle.CornerRadius}\" ry=\"{rectangle.CornerRadius}\" stroke=\"{Attribute(rectangle.StrokeColor)}\" stroke-width=\"{rectangle.StrokeWidth}\" fill=\"{Attribute(rectangle.FillColor)}\"/>");
break;
case DrawCircle circle:
Validate(circle.CenterX, circle.CenterY, circle.Radius, circle.StrokeWidth);
Positive(circle.Radius, circle.StrokeWidth);
svg.Append(CultureInfo.InvariantCulture,
$"<circle cx=\"{circle.CenterX}\" cy=\"{circle.CenterY}\" r=\"{circle.Radius}\" stroke=\"{Attribute(circle.StrokeColor)}\" stroke-width=\"{circle.StrokeWidth}\" fill=\"{Attribute(circle.FillColor)}\"/>");
break;
case DrawString text:
Validate(text.X, text.Y, text.FontSize);
Positive(text.FontSize);