fix(avatar): reduce model scale to 72% (from 85%) and tighten anchor to prevent right-side clipping in narrow sidebar
This commit is contained in:
@@ -72,13 +72,13 @@ export default function KiraAvatar(props: Props) {
|
|||||||
});
|
});
|
||||||
modelRef.current = model;
|
modelRef.current = model;
|
||||||
|
|
||||||
// Fit model to fill the canvas
|
// Fit model to fill the canvas — leave generous margin to avoid clipping
|
||||||
const maxW = containerW * 0.85;
|
const maxW = containerW * 0.72;
|
||||||
const maxH = containerH * 0.85;
|
const maxH = containerH * 0.72;
|
||||||
const scale = Math.min(maxW / model.width, maxH / model.height);
|
const scale = Math.min(maxW / model.width, maxH / model.height);
|
||||||
model.scale.set(scale);
|
model.scale.set(scale);
|
||||||
model.anchor.set(0.5, 0.55);
|
model.anchor.set(0.5, 0.52);
|
||||||
model.position.set(app.screen.width / 2, app.screen.height / 2 + 8);
|
model.position.set(app.screen.width / 2, app.screen.height / 2 + 6);
|
||||||
|
|
||||||
app.stage.addChild(model as any);
|
app.stage.addChild(model as any);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user