Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PixiJS: not drawing round rectangle correctly

After drawing a rounded rectangle the corner is not perfectly rounded. The corner is pixelated:

enter image description here

How can I draw a correctly rounded rectangle without the pixelated corner? Here is my code:

var graphics = new PIXI.Graphics();
graphics.beginFill(0x3e494b);
graphics.lineStyle(4, 0x0, .3);
graphics.drawRoundedRect(
    x,
    y,
    width,
    height,
    30
);
graphics.endFill();
like image 378
Captain Avatar asked Jan 22 '19 06:01

Captain


1 Answers

If your project uses a Pixi Application, try setting the antialias option to true. For example:

const app = new Application({antialias: true});
like image 135
matt_w Avatar answered Oct 19 '22 13:10

matt_w