Created
June 18, 2022 16:40
-
-
Save WhatIThinkAbout/8faba226dbbbd1261e32704b123d3979 to your computer and use it in GitHub Desktop.
draw_grid_lines.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def draw_grid( canvas ): | |
| canvas.stroke_style = '#777' # grid line color - medium gray | |
| canvas.line_width = 1 | |
| canvas.set_line_dash([4,8]) | |
| # draw the grid onto the canvas | |
| for y in range(grid_height): | |
| for x in range(grid_width): | |
| canvas.stroke_rect(cell_pixels * x, cell_pixels * y, cell_pixels, cell_pixels) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment