Merge branch 'master' of git@github.com:DmitryBaranovskiy/raphael

This commit is contained in:
Dmitry Baranovskiy 2008-12-23 17:43:06 +11:00
commit 2476336223
2 changed files with 6 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -1416,12 +1416,14 @@ var Raphael = (function (type) {
C.drawGrid = function (x, y, w, h, wv, hv, color) {
color = color || "#000";
var p = this.path({stroke: color, "stroke-width": 1})
.moveTo(x, y).lineTo(x + w, y).lineTo(x + w, y + h).lineTo(x, y + h).lineTo(x, y);
.moveTo(x, y).lineTo(x + w, y).lineTo(x + w, y + h).lineTo(x, y + h).lineTo(x, y),
rowHeight = h / hv,
columnWidth = w / wv;
for (var i = 1; i < hv; i++) {
p.moveTo(x, y + i * Math.round(h / hv)).lineTo(x + w, y + i * Math.round(h / hv));
p.moveTo(x, y + i * rowHeight).lineTo(x + w, y + i * rowHeight);
}
for (var i = 1; i < wv; i++) {
p.moveTo(x + i * Math.round(w / wv), y).lineTo(x + i * Math.round(w / wv), y + h);
p.moveTo(x + i * columnWidth, y).lineTo(x + i * columnWidth, y + h);
}
return p;
};