diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2012-11-27 15:31:52 -0500 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-12-17 15:03:07 +1000 |
commit | 707b4dc61f18960611409ef5ad8947be189f7296 (patch) | |
tree | a995a9644d4314aaf96ef332a97df5bb36eb900c /test | |
parent | 0a5a0d7c242add4d79721c1b90073b603a475534 (diff) |
barriers: Support line and ray barriers
This allows clients to add barriers that extend to the edge of the
screen. Clients are encouraged to use these instead of precise coordinates
in these cases to help prevent pointer leaks.
Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test')
-rw-r--r-- | test/fixes.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/fixes.c b/test/fixes.c index 7807c73ce..4ac6750e4 100644 --- a/test/fixes.c +++ b/test/fixes.c @@ -265,6 +265,32 @@ fixes_pointer_barriers_test(void) x2 = x + 100; assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + /* ray vert barrier */ + barrier.x1 = x; + barrier.x2 = x; + barrier.y1 = -1; + barrier.y2 = y + 100; + + /* ray barrier simple case */ + y1 = y; + y2 = y; + x1 = x + 50; + x2 = x - 50; + assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* endpoint outside y range; should be blocked */ + y1 = y - 1000; + y2 = y - 1000; + x1 = x + 50; + x2 = x - 50; + assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* endpoint outside y range */ + y1 = y + 150; + y2 = y + 150; + x1 = x + 50; + x2 = x - 50; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); } static void |