adjust blit w/h if patch x/y are negative

This commit is contained in:
Jon Dowland 2008-02-23 18:42:19 +00:00
parent 12d6d8ce02
commit dd9340af96

View file

@ -61,7 +61,10 @@ class ImagesExample:
dest_y = max(0, y) dest_y = max(0, y)
dest_height = min(pb.get_height(), image.get_pixbuf().get_height() - dest_y) dest_height = min(pb.get_height(), image.get_pixbuf().get_height() - dest_y)
dest_width = min(pb.get_width(), image.get_pixbuf().get_width() - dest_x) dest_width = min(pb.get_width(), image.get_pixbuf().get_width() - dest_x)
dest_x + dest_width if x < 0:
dest_width += x
if y < 0:
dest_height += y
offset_x = x offset_x = x
offset_y = y offset_y = y