void GuiWindow::ResetSize() { this->tree->SetupMinimalSize(this, this->widgets); this->rect = Rectangle32(this->rect.base.x, this->rect.base.y, this->tree->min_x, this->tree->min_y); Rectangle16 min_rect(0, 0, this->tree->min_x, this->tree->min_y); this->tree->SetSmallestSizePosition(min_rect); }
int main() { rect a = {4,4,10,17}; rect b = {2,2,22,22}; rect c = {2,14,11,11}; rect d = {11,2,12,12}; rect e = {7,10,8,8}; show(a); printf("intersect: %d\n", intersect2(a, b)); printf("intersect: %d\n", intersect2(a, c)); printf("intersect: %d\n", intersect2(a, d)); printf("intersect: %d\n", intersect2(a, e)); rect *r = min_rect(a, b); show(*r); }