Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function drawGrid() {
- var w = gridCanvas.width;
- var h = gridCanvas.height;
- gridContext.clearRect(0, 0, w, h);
- gridContext.beginPath();
- gridContext.strokeStyle = "#999999";
- gridContext.lineWidth = 0.3;
- var x = distanceBetweenLines;
- while(x <= w) {
- gridContext.moveTo(x, 0);
- gridContext.lineTo(x, h);
- x += distanceBetweenLines;
- }
- var y = distanceBetweenLines;
- while(y <= h) {
- gridContext.moveTo(0, y);
- gridContext.lineTo(w, y);
- y += distanceBetweenLines;
- }
- gridContext.stroke();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement