Skip to content

Instantly share code, notes, and snippets.

@h3

h3/gist:3912404

Created Oct 18, 2012
Embed
What would you like to do?
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