12 bool Region::overlappedBy(Region& d)
31 Region Region::subtract(Region& other)
33 OK printf("This: %i %i %i %i\n", x, y, w, h);
34 OK printf("Subtract this: %i %i %i %i\n", other.x, other.y, other.w, other.h);
41 OK printf("Case 1\n");
47 else if (x2() > other.x2())
49 OK printf("Case 2\n");
57 OK printf("Case 3\n");
63 else if (y2() > other.y2())
65 OK printf("Case 4\n");
78 OK printf("Result: %i %i %i %i\n", s.x, s.y, s.w, s.h);
84 //i.x = (x >= other.x ? x : other.x);
85 //i.y = (y >= other.y ? y : other.y);
86 //i.w = (x2() <= other.x2() ? x2() : other.x2()) - i.x;
87 //i.h = (y2() <= other.y2() ? y2() : other.y2()) - i.y;