Workaround for Firefox on android

Firefox on android has a bug related to canvas.clearRect. As a result the graphs aren't visible. This works around this issue
This commit is contained in:
haytjes 2014-01-27 18:58:38 +01:00
Родитель f15f936257
Коммит b9066cad05
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -251,8 +251,9 @@ Display.prototype.draw = function () {
var axis = plot.getAxes();
var rx = Math.round(axis.xaxis.c2p(x));
if (this.graph.timelist[rx] < this.graph.earliest) {
ctx.strokeRect(x - radius / 2, y - radius / 2, radius, radius);
ctx.clearRect(x - radius / 4, y - radius / 4, radius / 2, radius / 2);
ctx.strokeRect(x - radius / 3, y - radius / 3, radius * 2/3, radius * 2/3);
// Disable clearRect due to bug in Firefox for Android (bug 936177)
//ctx.clearRect(x - radius / 4, y - radius / 4, radius / 2, radius / 2);
} else {
ctx.arc(x, y, radius, 0, shadow ? Math.PI : Math.PI * 2, false);
}