feat: predvolena velkost fotky produktu 95 %

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jakub_HostacnyandClaude Opus 5.5 committed 2026-10-21 16:55:06 +02:00
1 parent afb8ae98c9
commit 31b9d605cf
2 files changed
+6 -4

No files matched your search

+4 -2
View File
@@ -29,6 +29,8 @@ export interface StoresOffset {
x?: number; // + doprava, − doľava
y?: number; // + vyššie nad cenovku, − nižšie (cez horný okraj cenovky)
}
// Predvolená veľkosť fotky produktu (zoom), keď ju produkt nemá nastavenú
export const DEFAULT_IMAGE_SCALE = 0.95;
// Predvolená poloha štítkov voči pravému hornému rohu pozadia cenovky
export const DEFAULT_STORES_OFFSET_X = -23;
// Predvolená výška jedného štítka predajne (px), nezávislá od veľkosti cenovky
@@ -214,7 +216,7 @@ export function cardVisualKey(p: CardProduct, ctx: CardContext): string {
const t = p.badgeCustomTemplate;
const relevant = [
ctx.variant, ctx.cardWidth, p.cardBgColor || ctx.cardBg, ctx.variant === 'standard' ? ctx.defaultBadge : null,
p.imageUrl, p.imageScale ?? 1, p.imageOffsetX || 0, p.imageOffsetY || 0,
p.imageUrl, p.imageScale ?? DEFAULT_IMAGE_SCALE, p.imageOffsetX || 0, p.imageOffsetY || 0,
p.customBadgePngUrl, badgeWidthFor(p, ctx.variant),
t ? [t.svgRaw, t.layersConfig, t.width] : null,
p.priceMain, p.priceSub, p.discountText, p.badgeText, p.unitPrice,
@@ -323,7 +325,7 @@ function renderVisualPreview(p: CardProduct, ctx: CardContext, key: string): str
const height = cardVisualHeight(ctx.cardWidth);
const bg = p.cardBgColor || ctx.cardBg;
const bw = badgeWidthFor(p, ctx.variant);
const scale = p.imageScale ?? 1;
const scale = p.imageScale ?? DEFAULT_IMAGE_SCALE;
const ox = p.imageOffsetX || 0;
const oy = p.imageOffsetY || 0;
const sx = Math.round(p.storesOffsetX ?? DEFAULT_STORES_OFFSET_X);