I am currently trying to draw arcs using the KineticJS canvas structure. The problem I am facing is that these arcs are not as good as required.
They are stretched as follows:
var redArc = new Kinetic.Shape({
drawFunc: function (canvas) {
var ctx = canvas.getContext();
ctx.beginPath();
ctx.arc(x, y, r, 0, Math.PI / 2, true);
canvas.fillStroke(this);
},
x: x,
y: y,
stroke: 'rgb(255,0,0)',
strokeWidth: 20,
offset: [x, y]
});
I knew this could be a problem since there is no such thing as rendering an almost perfect circle on a pixel environment without using anti-aliasing on the bar
I wandered if this problem could be solved by rendering with vector graphics or if there was an alternative solution?
I included JSFiddle to describe this problem, animation circles rotate around their axis. This effect is more noticeable when the arc appears when they rotate. "
JSFiddle: http://jsfiddle.net/EHDFV/