Bake Size slider zoom into saved SVG via viewBox crop

Fixkamo-internal
Shipped
11 มีนาคม 2569 เวลา 21:03 UTC
Author
kamo
Commit
334fbe5

Avatar Creator's internal scale transform zooms the avatar body within the SVG canvas, but the effect is imperceptible at small display sizes (e.g. a 140x140 Avatar component). The preview was using a redundant CSS transform: scale() to show the zoom, but that CSS is never part of the saved SVG, so preview and saved always looked different. New approach: - Remove scale from avatarOptions (no Avatar Creator internal scale transform) - Add applyViewBoxZoom() which shrinks the SVG viewBox to the centre crop equivalent to CSS transform:scale(N) with overflow:hidden — this is visible at any display size and survives being saved to MinIO - Apply applyViewBoxZoom in generateAvatar so the preview SVG already reflects the correct zoom without any CSS transform - Update addBackgroundToSvg to read all four viewBox values (x, y, w, h) so the background rect is correctly positioned after a viewBox crop

All changes

เหมือนที่คุณเห็นการขนส่ง?

ทุก คน ที่ ได้ รับ การ ปรับ ปรุง เหล่า นี้ จะ ลง ไป ใน ที่ ทํา งาน ของ คุณ โดย อัตโนมัติ. เริ่มให้อิสระและดูมันเติบโตสัปดาห์แล้วสัปดาห์เล่า.

เริ่ม เป็น อิสระ ตลอด ไปแสดงพริ้นซ์