Skip to content

Instantly share code, notes, and snippets.

@h3
Created October 18, 2012 15:02
Show Gist options
  • Save h3/3912404 to your computer and use it in GitHub Desktop.
Save h3/3912404 to your computer and use it in GitHub Desktop.
def dotted_line(**kwargs):
out = []
width = kwargs.get('right') - kwargs.get('left')
dash = kwargs.pop('dash')
dashcount = width / dash
new_kwargs = kwargs.copy()
new_kwargs['left'] = kwargs.get('left') - (dash * 2)
for d in range(0, int(dashcount)):
new_kwargs['left'] = new_kwargs['left'] + dash + dash
new_kwargs['right'] = new_kwargs['left'] + dash
new_kwargs['bottom'] = new_kwargs['top']
out.append(Line(**new_kwargs))
return out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment