/**********************************************************************
 
	Copyright (C) 2003 Hirohisa MORI <joshua@nichibun.ac.jp>
 
	This program is free software; you can redistribute it 
	and/or modify it under the terms of the GLOBALBASE 
	Library General Public License (G-LGPL) as published by 

	http://www.globalbase.org/
 
	This program is distributed in the hope that it will be 
	useful, but WITHOUT ANY WARRANTY; without even the 
	implied warranty of MERCHANTABILITY or FITNESS FOR A 
	PARTICULAR PURPOSE.

**********************************************************************/



#include	"v.h"


void
marge_vrect(VRECT * r1,VRECT * r2)
{
	if ( r1->tl.x >= r1->br.x ) {
		*r1 = *r2;
		return;
	}
	if ( r1->tl.x > r2->tl.x )
		r1->tl.x = r2->tl.x;
	if ( r1->tl.y > r2->tl.y )
		r1->tl.y = r2->tl.y;
	if ( r1->br.x < r2->br.x )
		r1->br.x = r2->br.x;
	if ( r1->br.y < r2->br.y )
		r1->br.y = r2->br.y;
}

