fix/tidy up the clipping so far

This commit is contained in:
Jon Dowland 2008-02-23 18:22:53 +00:00
parent 5e070745a6
commit 58efd180c3

View file

@ -49,7 +49,7 @@ class ImagesExample:
)) ))
pb = basepatch.get_pixbuf() pb = basepatch.get_pixbuf()
for x,y in [(0,0), (51,0), (104,16), (192,0)]: for x,y in [(0,0), (24,24), (104,16), (24,104)]:
x *= scale x *= scale
y *= scale y *= scale
image = gtk.Image() image = gtk.Image()
@ -58,9 +58,9 @@ class ImagesExample:
dest_x = x dest_x = x
dest_y = y dest_y = y
dest_width = pb.get_width() dest_height = min(pb.get_height(), image.get_pixbuf().get_height() - dest_y)
dest_height = pb.get_height() dest_width = min(pb.get_width(), image.get_pixbuf().get_width() - dest_x)
dest_height -= y dest_x + dest_width
offset_x = x offset_x = x
offset_y = y offset_y = y