- self.rect = pygame.Rect((-self.width/2,-self.height/2), (self.width, self.height))
+ # workarround cursor alignement problem
+ pygame.event.set_blocked(pygame.MOUSEMOTION)
+ pygame.mouse.set_pos(pygame.mouse.get_pos())
+ pygame.event.set_allowed(pygame.MOUSEMOTION)
+ # ---
+ x, y = pygame.mouse.get_pos()
+ left = x - self.width / 2
+ top = y - self.height / 2
+ self.rect = pygame.Rect((left, top), (self.width, self.height))