fix(avatar): reduce model margin to 45% to prevent clipping in narrow sidebar

This commit is contained in:
2026-06-05 09:51:39 -04:00
parent 13dbcdb7f5
commit 3a6a1cd6c3
+4 -4
View File
@@ -44,8 +44,8 @@ export default function KiraAvatar(props: Props) {
const fitModel = (crW: number, crH: number) => {
if (!model || !app) return;
const maxW = crW * 0.65;
const maxH = crH * 0.65;
const maxW = crW * 0.45;
const maxH = crH * 0.45;
const s = Math.min(maxW / model.width, maxH / model.height);
model.scale.set(s);
model.position.set(app.screen.width / 2, app.screen.height / 2);
@@ -90,8 +90,8 @@ export default function KiraAvatar(props: Props) {
modelRef.current = model;
// Fit model with generous margin to avoid clipping
const maxW = w * 0.65;
const maxH = h * 0.65;
const maxW = w * 0.45;
const maxH = h * 0.45;
const scale = Math.min(maxW / model.width, maxH / model.height);
model.scale.set(scale);
model.anchor.set(0.5, 0.5);