if marker-line-width is 0 no border should be renderered fixed #16

This commit is contained in:
javi 2013-10-10 10:58:55 +02:00
parent fe8f58fd38
commit fd03f92b83

View File

@ -6,8 +6,11 @@
function renderPoint(ctx, st) {
ctx.fillStyle = st.fillStyle;
ctx.strokStyle = st.strokStyle;
var pixel_size = st['point-radius']
var pixel_size = st['point-radius'];
// render a circle
// fill
ctx.beginPath();
ctx.arc(0, 0, pixel_size, 0, TAU, true, true);
ctx.closePath();
@ -17,8 +20,10 @@
}
ctx.fill();
}
// stroke
ctx.globalAlpha = 1.0;
if(st.strokeStyle) {
if (st.strokeStyle && st.lineWidth) {
if (st.strokeOpacity) {
ctx.globalAlpha = st.strokeOpacity;
}
@ -26,9 +31,13 @@
ctx.lineWidth = st.lineWidth;
}
ctx.strokeStyle = st.strokeStyle;
// do not render for alpha = 0
if (ctx.globalAlpha > 0) {
ctx.stroke();
}
}
}
function renderSprite(ctx, st) {
var img = st['point-file'] || st['marker-file'];