From 9772297f2414f85d097b04727752a9eba0713c1a Mon Sep 17 00:00:00 2001 From: Paras Date: Thu, 27 May 2021 08:46:14 +0530 Subject: [PATCH] Fixed Deprecation Warning [issue 15] --- GUI.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/GUI.py b/GUI.py index d39a705..35c4993 100644 --- a/GUI.py +++ b/GUI.py @@ -51,7 +51,7 @@ def sketch(self, val): def draw(self): # Draw Grid Lines - gap = self.width / 9 + gap = self.width // 9 for i in range(self.rows+1): if i % 3 == 0 and i != 0: thick = 4 @@ -163,7 +163,7 @@ def __init__(self, value, row, col, width, height): def draw(self, win): fnt = pygame.font.SysFont("comicsans", 40) - gap = self.width / 9 + gap = self.width // 9 x = self.col * gap y = self.row * gap @@ -172,22 +172,22 @@ def draw(self, win): win.blit(text, (x+5, y+5)) elif not(self.value == 0): text = fnt.render(str(self.value), 1, (0, 0, 0)) - win.blit(text, (x + (gap/2 - text.get_width()/2), y + (gap/2 - text.get_height()/2))) + win.blit(text, (x + (gap // 2 - text.get_width() // 2), y + (gap // 2 - text.get_height() // 2))) if self.selected: - pygame.draw.rect(win, (255,0,0), (x,y, gap ,gap), 3) + pygame.draw.rect(win, (255, 0, 0), (x, y, gap, gap), 3) def draw_change(self, win, g=True): fnt = pygame.font.SysFont("comicsans", 40) - gap = self.width / 9 + gap = self.width // 9 x = self.col * gap y = self.row * gap pygame.draw.rect(win, (255, 255, 255), (x, y, gap, gap), 0) text = fnt.render(str(self.value), 1, (0, 0, 0)) - win.blit(text, (x + (gap / 2 - text.get_width() / 2), y + (gap / 2 - text.get_height() / 2))) + win.blit(text, (x + (gap // 2 - text.get_width() // 2), y + (gap // 2 - text.get_height() // 2))) if g: pygame.draw.rect(win, (0, 255, 0), (x, y, gap, gap), 3) else: