int main(void) { int num_rect; scanf("%d", &num_rect); int x1, y1, x2, y2; int i, k; for(i=0;i<num_rect;i++) { for(k=0;k<4;k++) { scanf("%d %d %d %d", &x1, &y1, &x2, &y2); init_line(lines+k, x1, y1, x2, y2); } if(is_valid_rect()) printf("YES"); else printf("NO"); printf("\n"); } return 0; }
void twidget::place(const tpoint& origin, const tpoint& size) { if (!is_valid_rect(fix_rect_)) { assert(size.x >= 0); assert(size.y >= 0); x_ = origin.x; y_ = origin.y; w_ = size.x; h_ = size.y; } else { x_ = fix_rect_.x; y_ = fix_rect_.y; w_ = fix_rect_.w; h_ = fix_rect_.h; } set_dirty(); }