响应Bodymovin动画
答
你可以玩的渲染器的preserveAspectRatio设置。 把它作为一个PARAM当您加载动画:
bodymovin.loadAnimation({
container: element,
renderer: 'svg',
loop: true,
autoplay: true,
path: 'path/to/the/json',
rendererSettings: {
preserveAspectRatio: 'xMidYMid meet'
}
});
我猜你想要的这里是preserveAspectRatio:“xMidYMid片”