Lines Matching refs:other
103 RAreaIntersect(const RArea *self, const RArea *other)
106 if(RAreaIsIntersect(self, other)) {
109 x1 = max(other->x, self->x);
110 x2 = min(RAreaX2(other), RAreaX2(self));
112 y1 = max(other->y, self->y);
113 y2 = min(RAreaY2(other), RAreaY2(self));
127 RAreaIsIntersect(const RArea *self, const RArea *other)
129 // [other][self]
130 if(RAreaX2(other) < self->x) {
134 // [self][other]
135 if(other->x > RAreaX2(self)) {
139 // [other]
141 if(RAreaY2(other) < self->y) {
146 // [other]
147 if(other->y > RAreaY2(self)) {
179 RAreaHorizontalUnion(const RArea *self, const RArea *other)
183 // [other] [self] or [self] [other]
184 if(RAreaX2(other) < self->x - 1) {
187 if(other->x > RAreaX2(self) + 1) {
192 // [other] or [self]
193 // [self] [other]
194 if(RAreaY2(other) < self->y || other->y > RAreaY2(self)) {
196 // X coordinate, _and_ are touching each other vertically, we can
198 if(self->width == other->width && self->x == other->x) {
199 // [other]
201 if(RAreaY2(other) + 1 == self->y) {
204 RAreaNewStatic(self->x, other->y,
205 self->width, self->height + other->height),
210 // [other]
211 if(RAreaY2(self) + 1 == other->y) {
215 self->width, self->height + other->height),
232 const int min_x = min(self->x, other->x);
233 const int max_x = max(RAreaX2(self), RAreaX2(other));
240 if(self->y < other->y) {
242 bot = other;
245 top = other;
304 RAreaVerticalUnion(const RArea *self, const RArea *other)
307 if(RAreaY2(other) < self->y - 1) {
310 if(other->y > RAreaY2(self) + 1) {
315 // [other][self] or [self][other]
316 if(RAreaX2(other) < self->x || other->x > RAreaX2(self)) {
318 // Y coordinate, _and_ are touching each other horizontally, we can
320 if(self->height == other->height && self->y == other->y) {
321 // [other][self]
322 if(RAreaX2(other) + 1 == self->x) {
325 RAreaNewStatic(other->x, self->y,
326 self->width + other->width, self->height),
330 // [self][other]
331 if(RAreaX2(self) + 1 == other->x) {
335 self->width + other->width, self->height),
348 const int min_y = min(self->y, other->y);
349 const int max_y = max(RAreaY2(self), RAreaY2(other));
356 if(self->x < other->x) {
358 right = other;
361 left = other;
382 // of a piece to the right of one or the other.