imtk

diff src/layout.c @ 27:48e708baa7be

added predicate imtk_layout_contains(x, y)
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 12 Dec 2020 17:20:00 +0200
parents f416d8def7ef
children
line diff
     1.1 --- a/src/layout.c	Thu Mar 20 07:00:38 2014 +0200
     1.2 +++ b/src/layout.c	Sat Dec 12 17:20:00 2020 +0200
     1.3 @@ -99,3 +99,14 @@
     1.4  {
     1.5  	memcpy(bbox, st[top].box, sizeof st[top].box);
     1.6  }
     1.7 +
     1.8 +int imtk_layout_contains(int x, int y)
     1.9 +{
    1.10 +	if(x < st[top].box[0] || x >= st[top].box[0] + st[top].box[2]) {
    1.11 +		return 0;
    1.12 +	}
    1.13 +	if(y < st[top].box[1] || y >= st[top].box[1] + st[top].box[3]) {
    1.14 +		return 0;
    1.15 +	}
    1.16 +	return 1;
    1.17 +}