我Raphael JS library
在 Chrome 和 Safari 中使用了一些错误
元素属性 -value 的负值无效
Error: Invalid negative value for <image> attribute width="-3364.67" (index):1
Error: Invalid negative value for <image> attribute height="-3364.67" (index):1
Error: Invalid negative value for <image> attribute width="-3364.6662980435035" (index):1
Error: Invalid negative value for <image> attribute height="-3364.6662980435035" (index):1
Error: Invalid negative value for <image> attribute width="-3364.6662980435035" raphael.js:6153
Error: Invalid negative value for <image> attribute height="-3364.6662980435035" raphael.js:6175
Error: Invalid negative value for <image> attribute width="-3364.6662980435035" raphael.js:6153
Error: Invalid negative value for <image> attribute height="-3364.6662980435035" raphael.js:6175
也许有人有这种情况,可以给我一些建议。
提前 THX
问题在 Raphael.js 的第 6153 和 6175 行
case "width":
node.setAttribute(att, value);
o._.dirty = 1;
if (attrs.fx) {
att = "x";
value = attrs.x;
} else {
break;
}
和
case "height":
node.setAttribute(att, value);
o._.dirty = 1;
if (attrs.fy) {
att = "y";
value = attrs.y;
} else {
break;
}