我刚刚开始玩 snap 并且一直在尝试以英寸而不是像素为单位工作,这可能吗?如果是这样,我该如何使用英寸?似乎有些功能接受英寸而有些不接受?
// This works
var s = Snap("1.5in", "1.5in");
// This works
s.rect("0in", "0in", "1.5in", "1.5in").attr({
stroke: "#f00",
fill: "transparent"
});
// This works
s.path("M0,144L144,0").attr({
stroke: "#f00"
});
// This fails (Error: Invalid value for <path> attribute d="M0in,0inL1.5in,1.5in")
s.path("M0in,0inL1.5in,1.5in").attr({
stroke: "#f00"
});