PixiJS:未正确绘制圆角矩形

Cap*_*ain 6 javascript pixi.js

绘制圆角矩形后,角不是完美的圆角。角被像素化:

在此处输入图片说明

如何在没有像素化角的情况下绘制正确的圆角矩形?这是我的代码:

var graphics = new PIXI.Graphics();
graphics.beginFill(0x3e494b);
graphics.lineStyle(4, 0x0, .3);
graphics.drawRoundedRect(
    x,
    y,
    width,
    height,
    30
);
graphics.endFill();
Run Code Online (Sandbox Code Playgroud)

小智 3

如果您的项目使用 Pixi Application,请尝试将 antialias 选项设置为 true。例如:

const app = new Application({antialias: true});
Run Code Online (Sandbox Code Playgroud)