diff --git a/src/lib/ae_events/types/ae_badge_template_cfg.ts b/src/lib/ae_events/types/ae_badge_template_cfg.ts index 83a43f46..52d986fa 100644 --- a/src/lib/ae_events/types/ae_badge_template_cfg.ts +++ b/src/lib/ae_events/types/ae_badge_template_cfg.ts @@ -76,6 +76,10 @@ export interface BadgeTemplateCfg { center_bg?: string; center_rainbow?: boolean; slow_pulse?: boolean; // when true: slow breathing pulse instead of fast linear cycle + // Extra horizontal inset per side (mm) beyond the 1mm base safety margin. + // Shrinks the visible marker width to keep it inside the physical hole on + // printers or badge stock with variance. Default 2 when unset (see view component). + inset_x_mm?: number; }; // Allow arbitrary extra keys to preserve forward-compatibility. diff --git a/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_obj_view.svelte b/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_obj_view.svelte index 792d73de..28f1ff49 100644 --- a/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_obj_view.svelte +++ b/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_obj_view.svelte @@ -332,6 +332,11 @@ let punch_holes_left = $derived(!!template_cfg?.punch_holes?.left); let punch_holes_right = $derived(!!template_cfg?.punch_holes?.right); let punch_holes_center = $derived(!!template_cfg?.punch_holes?.center); +// Horizontal inset per side applied to each marker, in mm. +// Default 2mm — enough to stay inside the hole on real badge stock with typical printer variance. +// Increase via punch_holes.inset_x_mm in the template config if a printer or stock runs long. +let punch_holes_inset_x = $derived(template_cfg?.punch_holes?.inset_x_mm ?? 2); + // Per-slot colors: slot-specific override → shared fallback → component default. // When rainbow is on and no explicit fg/bg is set, use a saturated base color so // hue-rotate produces a full visible spectrum (gray has no hue to rotate). @@ -697,7 +702,10 @@ const code_to_icon: {