Fix test broken by clipping of images to screen area

This commit is contained in:
Kovid Goyal 2017-10-06 22:34:21 +05:30
parent 4bc852e615
commit ad5a276ddb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -204,7 +204,7 @@ class TestGraphics(BaseTest):
self.ae(len(l), 2) self.ae(len(l), 2)
rect_eq(l[0]['src_rect'], 2 / 10, 1 / 20, (2 + 3) / 10, (1 + 5)/20) rect_eq(l[0]['src_rect'], 2 / 10, 1 / 20, (2 + 3) / 10, (1 + 5)/20)
left, top = -1 + dx + 3 * dx / cw, 1 - 1 * dy / ch left, top = -1 + dx + 3 * dx / cw, 1 - 1 * dy / ch
rect_eq(l[0]['dest_rect'], left, top, -1 + (1 + s.columns) * dx, top - dy * 5 / ch) rect_eq(l[0]['dest_rect'], left, top, min(1, -1 + (1 + s.columns) * dx), max(-1, top - dy * 5 / ch))
rect_eq(l[1]['src_rect'], 0, 0, 1, 1) rect_eq(l[1]['src_rect'], 0, 0, 1, 1)
rect_eq(l[1]['dest_rect'], -1, 1, -1 + dx, 1 - dy) rect_eq(l[1]['dest_rect'], -1, 1, -1 + dx, 1 - dy)
self.ae(l[0]['group_count'], 1), self.ae(l[1]['group_count'], 1) self.ae(l[0]['group_count'], 1), self.ae(l[1]['group_count'], 1)