title: Subsurface rect outside of surface area when using get_clip() in Pygame?
body: <p>I am currently working on a pygame, trying to animate my character so that as the player moves him the program will cycle through four sprite image subsurfaces. I already setup a class for this: </p>
  
  <pre><code>import pygame
  from pygame.locaks import *
  
  class Prota:
  
      def __init__(self, sheet):
          self.sheet = pygame.image.load(sheet).convert_alpha()
          self.image_rect = self.sheet.get_rect()
          self.image_rect_h = (self.image_rect.height) #num of rows
          self.image_rect_w = (self.image_rect.width/16) #num of columns
          self.image_reel = self.fetch()
          self.image_cue = 0 #index: 0 - 3 (Right), 4 - 7 (Left), 8 - 11 (Front), 12 - 15 (Back)
          self.clock = pygame.time.Clock()
  
      def draw(self, screen):
          self.clock.tick(60)
          screen.blit(self.image_reel[self.image_cue], (400, 300))
  
      def fetch(self):
          sprites = []
  
          for x in range(0, 15):
              self.sheet.set_clip(pygame.Rect(self.image_rect_h*x, 0, self.image_rect_w, self.image_rect_h))
              sprite = self.sheet.subsurface(self.sheet.get_clip())
              sprites.append(sprite)
          return sprites
  </code></pre>
  
  <p>And it worked perfectly when I used a dummy sprite sheet (just a simple 50 x 50 square sprite that changes colors), but when I tried to implement my (partially complete) actually character sheet, I got back</p>
  
  <pre><code>ValueError: subsurface rectangle outside surface area
  </code></pre>
  
  <p>I am not sure if it's the size of sheets (the dummy sheet was 832 x 52px, and the character sheet is 1008 x 79px), or what, and I can't seem to find any article that addresses this issue. (The closest I could find in a quick search was <a href="https://stackoverflow.com/questions/4183208/how-do-i-rotate-an-image-around-its-center-using-pygame">How to rotate images in pygame</a></p>
  
  <p>Any ideas? </p>