Drawning lines in html canvas generate pixel color artefacts on line border

Viewed 43

I have simple app that redraw lines on canvas using specified coordinates. After drawning some pixels on line border have different color from specified in strokeStyle.

Example: https://pp.userapi.com/c852136/v852136145/15332c/9Brhqd_xAro.jpg

I'm trying to disable anti-aliasing, but it doesn't help.

Function used in drawning lines:

    function drawLine(ctx,points,color) {
        ctx.strokeStyle = color;
            ctx.lineWidth = 4;
            ctx.beginPath();
            ctx.moveTo(points[0],points[1]);
            ctx.lineTo(points[2],points[3]);
            ctx.stroke();
     }
0 Answers
Related