This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via ea13b90643f283c3296b5a0621fb32e937eaf87b (commit) via 218adc04c0f5748b3709b2653fb1d14fb62f6cc0 (commit) via 892b5f173094333af4d8184991bb9404759c48a7 (commit) from 3934f00a09db3fc608a39c15889d0788565b7e36 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/ea13b90643f283c3296b5a0621fb32e937eaf...
commit ea13b90643f283c3296b5a0621fb32e937eaf87b Author: Tomas Gavenciak gavento@ucw.cz Date: Wed Jan 2 01:18:57 2013 +0100
core: pylib: Fix off-by-one in Blit wrapper
diff --git a/pylib/gfxprim/core/__init__.py b/pylib/gfxprim/core/__init__.py index fdf3017..f9db954 100644 --- a/pylib/gfxprim/core/__init__.py +++ b/pylib/gfxprim/core/__init__.py @@ -127,13 +127,15 @@ def _init(module): assert sum([w is not None, sx2 is not None, tx2 is not None]) == 1 assert sum([h is not None, sy2 is not None, ty2 is not None]) == 1 if sx2 is not None: - w = max(0, sx2 - sx) + w = max(0, sx2 - sx + 1) if tx2 is not None: - w = max(0, tx2 - tx) + w = max(0, tx2 - tx + 1) if sy2 is not None: - h = max(0, sy2 - sy) + h = max(0, sy2 - sy + 1) if ty2 is not None: - h = max(0, ty2 - ty) + h = max(0, ty2 - ty + 1) + if (w < 0) or (h < 0): + raise ValueError("Size of blit rect must be non-negative.") return c_core.GP_BlitXYWH_Clipped(self, sx, sy, w, h, target, tx, ty)
# Color conversions
http://repo.or.cz/w/gfxprim.git/commit/218adc04c0f5748b3709b2653fb1d14fb62f6...
commit 218adc04c0f5748b3709b2653fb1d14fb62f6cc0 Author: Tomas Gavenciak gavento@ucw.cz Date: Wed Jan 2 01:17:17 2013 +0100
core: pylib: Expand blit tests (rectangle formats)
diff --git a/tests/pylib/test_core.py b/tests/pylib/test_core.py index aad219e..80d0408 100644 --- a/tests/pylib/test_core.py +++ b/tests/pylib/test_core.py @@ -157,21 +157,31 @@ def test_subcontext_vs_blit(t): def test_blits_by_rect(t): "Blit defined by XYXY, XYX2Y2 and XYWH" c = ContextRand(17, 13, t, seed=765) - c2a = ContextRand(16, 15, t) - c2b = ContextRand(16, 15, t) - c2c = ContextRand(16, 15, t) + c2a = ContextRand(16, 15, t, seed=4) + c2b = ContextRand(16, 15, t, seed=4) + c2c = ContextRand(16, 15, t, seed=4) + c2d = ContextRand(16, 15, t, seed=4) + c2e = ContextRand(16, 15, t, seed=4) assert c2a == c2b assert c2a == c2c + assert c2a == c2d + assert c2a == c2e assert c != c2a
c.Blit(3, 4, c2a, 5, 2, w=4, h=5) - assert c2a != c2c - c.Blit(3, 4, c2b, 5, 2, w=4, h=5) - assert c2b != c2c - c.Blit(3, 4, c2c, 5, 2, w=4, h=5) + assert c2a != c2e + c.Blit(3, 4, c2b, 5, 2, sx2=6, sy2=8) + assert c2b != c2e + c.Blit(3, 4, c2c, 5, 2, tx2=8, ty2=6) + assert c2c != c2e + core.c_core.GP_BlitXYWH(c, 3, 4, 4, 5, c2d, 5, 2) + assert c2d != c2e + core.c_core.GP_BlitXYXY(c, 3, 4, 6, 8, c2e, 5, 2)
assert c2a == c2b assert c2a == c2c + assert c2a == c2d + assert c2a == c2e
# 'RGBAToPixel',
http://repo.or.cz/w/gfxprim.git/commit/892b5f173094333af4d8184991bb9404759c4...
commit 892b5f173094333af4d8184991bb9404759c48a7 Author: Tomas Gavenciak gavento@ucw.cz Date: Wed Jan 2 01:16:21 2013 +0100
pylib: test: Fix generated func globals and name
diff --git a/tests/pylib/testutils.py b/tests/pylib/testutils.py index 4edb403..cdc5c9d 100644 --- a/tests/pylib/testutils.py +++ b/tests/pylib/testutils.py @@ -24,10 +24,11 @@ def alltypes_new_functions(_filter=None): if (_filter is None) or _filter(t): nf = lambda: f(t) nf.__name__ = f.__name__ + "_" + t.name + nf.__module__ = f.__module__ nf.__doc__ = "%s<%s:%s>"% ( f.__doc__ + " " if f.__doc__ else "", - __name__, nf.__name__) - globals()[nf.__name__] = nf + nf.__module__, nf.__name__) + f.__globals__[nf.__name__] = nf return None return decorate
-----------------------------------------------------------------------
Summary of changes: pylib/gfxprim/core/__init__.py | 10 ++++++---- tests/pylib/test_core.py | 24 +++++++++++++++++------- tests/pylib/testutils.py | 5 +++-- 3 files changed, 26 insertions(+), 13 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.