Fix flake8

This commit is contained in:
9and3r
2015-05-23 15:04:02 +02:00
parent f4074da9e1
commit eefc6c40ef
4 changed files with 55 additions and 61 deletions

View File

@@ -3,7 +3,7 @@ import pygame
change_speed = 2
class DynamicBackground():
class DynamicBackground:
def __init__(self, size):
self.image_loaded = False
@@ -41,14 +41,14 @@ class DynamicBackground():
self.update = True
def get_aspect_scale_size(img, (bx, by)):
@staticmethod
def get_aspect_scale_size(img, size):
size = img.get_size()
aspect_x = bx / float(size[0])
aspect_y = by / float(size[1])
aspect_x = size[0] / float(size[0])
aspect_y = size[1] / float(size[1])
if aspect_x > aspect_y:
aspect = aspect_x
else:
aspect = aspect_y
new_size = (int(aspect*size[0]), int(aspect*size[1]))
return new_size