Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
curry = self._pad
for x in range(self._width):
for y in range(self._height):
if (x,y) in self._waffle_pixels.keys():
# if pixel already exist, reuse it and update the values
old_pixel = self._waffle_pixels[(x,y)]
new_waffle_pixels[x,y] = WafflePixel(
x, y,
self._canvas, currx, curry,
self._pixel_size,
old_pixel.dotty,
old_pixel.color)
else:
# create a new celpixell
new_waffle_pixels[x,y] = WafflePixel(
x, y,
self._canvas, currx, curry,
self._pixel_size,
self._dotty,
self._color)
curry += self._pixel_size + self._pad
currx += self._pixel_size + self._pad
curry = self._pad
self._waffle_pixels = new_waffle_pixels
def _size_waffle(self):
# create new pixels
new_waffle_pixels = {}
currx = self._pad
curry = self._pad
for x in range(self._width):
for y in range(self._height):
if (x,y) in self._waffle_pixels.keys():
# if pixel already exist, reuse it and update the values
old_pixel = self._waffle_pixels[(x,y)]
new_waffle_pixels[x,y] = WafflePixel(
x, y,
self._canvas, currx, curry,
self._pixel_size,
old_pixel.dotty,
old_pixel.color)
else:
# create a new celpixell
new_waffle_pixels[x,y] = WafflePixel(
x, y,
self._canvas, currx, curry,
self._pixel_size,
self._dotty,
self._color)
curry += self._pixel_size + self._pad