feat: Circle/RoundedRectangle-Zeichenbefehle im Canvas-Backend, Fehlzeitenkalender-Kacheln größer
CI / build-and-test (push) Waiting to run
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:
@@ -44,11 +44,18 @@ public static class StudentAttendanceCalendarDrawingBuilder
|
||||
// würde am rechten Rand abgeschnitten (SVG overflow="hidden").
|
||||
var contentWidth = width;
|
||||
var cellHeight = 10 * scale;
|
||||
var monthGapX = 10f;
|
||||
// War 10 - bei 3 Monaten nebeneinander größer als eine einzelne Tageskachel und zog damit
|
||||
// spürbar Platz von den Kacheln ab, ohne selbst als Inhalt wahrgenommen zu werden.
|
||||
var monthGapX = 6f;
|
||||
var first = options.NormalizedStartMonth;
|
||||
var monthCount = options.NormalizedMonthCount;
|
||||
var monthWidth = (contentWidth - monthGapX * (monthCount - 1)) / monthCount;
|
||||
var cellWidth = monthWidth / 7;
|
||||
// Kachel-Zwischenraum (Trennung zu Nachbarzellen) deutlich knapper als vorher (war "scale",
|
||||
// also bis zu 1mm auf jeder Seite - bei einer ~7mm breiten Zelle ein gutes Viertel reiner
|
||||
// Leerraum). Die Kachel selbst füllt dadurch ihren Rasterplatz sichtbar besser aus.
|
||||
var cellInset = scale * .4f;
|
||||
var cellCornerRadius = Math.Min(cellWidth, cellHeight) * .2f;
|
||||
var commands = new List<DrawingCommand>();
|
||||
var y = 0f;
|
||||
commands.Add(new DrawStringEx(0, y, 14 * scale, contentWidth, "Anwesenheit",
|
||||
@@ -86,8 +93,9 @@ public static class StudentAttendanceCalendarDrawingBuilder
|
||||
var row = index / 7;
|
||||
var x = xOffset + column * cellWidth;
|
||||
var cellY = monthY + row * cellHeight;
|
||||
commands.Add(new DrawRectangle(x + scale, cellY, cellWidth - 2 * scale, cellHeight - scale,
|
||||
"#D1D5DB", .35f, day.HasSignal ? day.SignalColorHex : "#FFFFFF"));
|
||||
commands.Add(new DrawRoundedRectangle(x + cellInset, cellY, cellWidth - 2 * cellInset,
|
||||
cellHeight - cellInset, cellCornerRadius, "#D1D5DB", .35f,
|
||||
day.HasSignal ? day.SignalColorHex : "#FFFFFF"));
|
||||
commands.Add(new DrawStringEx(x, cellY + scale, cellHeight - 2 * scale, cellWidth,
|
||||
day.HasSignal ? day.SignalCode : day.DayNumber, DrawingTextAlignment.AlignCenter, 7 * scale,
|
||||
Color: day.HasSignal ? "#FFFFFF" : "#374151", Bold: day.HasSignal));
|
||||
|
||||
Reference in New Issue
Block a user