]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blobdiff - helpers/key.py
Fix threading problems with ipython
[perso/Immae/Projets/Python/MusicSampler.git] / helpers / key.py
index 9a6cb3b29f2a1b0270a1081490eab4efdc90f844..e9e485d11d52d45a61c0d73060aa66895f611a7a 100644 (file)
@@ -72,7 +72,7 @@ class Key:
                 )
 
     def set_description(self, description):
-        self.description = description
+        self.description = [str(desc) for desc in description]
 
     def set_color(self, color):
         self.custom_color = tuple(color)
@@ -97,7 +97,7 @@ class Key:
         self.surface.blit(text, (5,5))
 
         is_first_line = True
-        offset = 11 + text_police.get_linesize()
+        offset = 11 + text_police.get_linesize() - 4
         first_line_offset = 18
         for description in self.description:
             text = text_police.render(description, True, (0,0,0))
@@ -105,8 +105,8 @@ class Key:
                 self.surface.blit(text, (first_line_offset, 9))
                 is_first_line = False
             else:
-                self.surface.blit(text, (5, offset))
-                offset += text_police.get_linesize()
+                self.surface.blit(text, (3, offset))
+                offset += text_police.get_linesize() - 4
 
         background_surface.blit(self.surface, self.position)
         self.draw_lock.release()