added watermark settings tab on the branding page and added more package details to the billing page, added a new guest notifications page
This commit is contained in:
@@ -33,7 +33,7 @@ class WatermarkConfigResolver
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{type:string, policy:string, asset?:string, position?:string, opacity?:float, scale?:float, padding?:int}
|
||||
* @return array{type:string, policy:string, asset?:string, position?:string, opacity?:float, scale?:float, padding?:int, offset_x?:int, offset_y?:int}
|
||||
*/
|
||||
public static function resolve(Event $event): array
|
||||
{
|
||||
@@ -61,6 +61,8 @@ class WatermarkConfigResolver
|
||||
'opacity' => $baseSetting?->opacity ?? config('watermark.base.opacity', 0.25),
|
||||
'scale' => $baseSetting?->scale ?? config('watermark.base.scale', 0.2),
|
||||
'padding' => $baseSetting?->padding ?? config('watermark.base.padding', 16),
|
||||
'offset_x' => $baseSetting?->offset_x ?? config('watermark.base.offset_x', 0),
|
||||
'offset_y' => $baseSetting?->offset_y ?? config('watermark.base.offset_y', 0),
|
||||
];
|
||||
|
||||
$event->loadMissing('eventPackage.package', 'tenant');
|
||||
@@ -91,6 +93,8 @@ class WatermarkConfigResolver
|
||||
$opacity = (float) ($source['opacity'] ?? $base['opacity'] ?? 0.25);
|
||||
$scale = (float) ($source['scale'] ?? $base['scale'] ?? 0.2);
|
||||
$padding = (int) ($source['padding'] ?? $base['padding'] ?? 16);
|
||||
$offsetX = (int) ($source['offset_x'] ?? $base['offset_x'] ?? 0);
|
||||
$offsetY = (int) ($source['offset_y'] ?? $base['offset_y'] ?? 0);
|
||||
|
||||
$clamp = static fn (float $value, float $min, float $max) => max($min, min($max, $value));
|
||||
|
||||
@@ -102,6 +106,8 @@ class WatermarkConfigResolver
|
||||
'opacity' => $clamp($opacity, 0.0, 1.0),
|
||||
'scale' => $clamp($scale, 0.05, 1.0),
|
||||
'padding' => max(0, $padding),
|
||||
'offset_x' => max(-500, min(500, $offsetX)),
|
||||
'offset_y' => max(-500, min(500, $offsetY)),
|
||||
'serve_originals' => $serveOriginals,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user