Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _gen_grid(self, dx, dy, width=0.5):
xmax, ymax = 1000, 1000
x, y = 0, 0
lines = []
txt = []
while x < xmax:
lines.append(_transform.LineElement([(x, 0), (x, ymax)],
width=width))
txt.append(_transform.TextElement(x, dy/2, str(x), size=self.size))
x += dx
while y < ymax:
lines.append(_transform.LineElement([(0, y), (xmax, y)],
width=width))
txt.append(_transform.TextElement(0, y, str(y), size=self.size))
y += dy
return lines+txt
def _gen_grid(self, dx, dy, width=0.5):
xmax, ymax = 1000, 1000
x, y = 0, 0
lines = []
txt = []
while x < xmax:
lines.append(_transform.LineElement([(x, 0), (x, ymax)],
width=width))
txt.append(_transform.TextElement(x, dy/2, str(x), size=self.size))
x += dx
while y < ymax:
lines.append(_transform.LineElement([(0, y), (xmax, y)],
width=width))
txt.append(_transform.TextElement(0, y, str(y), size=self.size))
y += dy
return lines+txt
def __init__(self, points, width=1, color='black'):
element = _transform.LineElement(points, width=width, color=color)
Element.__init__(self, element.root)