I'd like to draw some kind of popyline chart using pixijs lineTo method. The problem is the lines are rendered outside dedicated area.
Sample:
var stage = new PIXI.Stage(0xFFFFFE);
var renderer = new PIXI.WebGLRenderer(600, 600);
document.body.appendChild(renderer.view);
var graphics = new PIXI.Graphics();
graphics.lineStyle(1, 0x0000FF, 1);
graphics.moveTo(0, 50);
graphics.lineTo(50, 50);//draw min Y line
graphics.moveTo(0, 100);
graphics.lineTo(50, 100);//draw max Y line
graphics.moveTo(60, 50);
graphics.lineTo(60 + 0.1, 100);
graphics.lineTo(60 + 0.2, 50);
stage.addChild(graphics);
requestAnimFrame(animate);
function animate() {
requestAnimFrame(animate);
renderer.render(stage);
}
Result:
Why it happens and how to avoid it?