Skip to content

Instantly share code, notes, and snippets.

@WhatIThinkAbout
Created June 18, 2022 16:40
Show Gist options
  • Select an option

  • Save WhatIThinkAbout/8faba226dbbbd1261e32704b123d3979 to your computer and use it in GitHub Desktop.

Select an option

Save WhatIThinkAbout/8faba226dbbbd1261e32704b123d3979 to your computer and use it in GitHub Desktop.
draw_grid_lines.py
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