Using pointStyle “rectRot” on retina display causes points to be drawn incorrectly

If you use a pointStyle of “rectRot” and view the chart on a retina display then the points are drawn in the top 25%% of the canvas (i.e. the x and y coordinates of the points are halved). This affects Line and Scatter charts.

I’m guessing this has something to do with the rotating of the rectangle for the point.

http://jsbin.com/gebamox/edit?html,output

Author: Fantashit

1 thought on “Using pointStyle “rectRot” on retina display causes points to be drawn incorrectly

  1. Yes, just the rectRot.

    Potential fix in element.point.js:

    case 'rectRot':
        ctx.beginPath();
        size = 1 / Math.SQRT2 * radius;
        ctx.moveTo(x - size, y);
        ctx.lineTo(x, y + size);
        ctx.lineTo(x + size, y);
        ctx.lineTo(x, y - size);
        ctx.closePath(x - size, y);
        ctx.fill();
        break;

    This gets rid of need for rotation.

Comments are closed.