Esempio n. 1
0
bool rect<_t, _rt, _it>::_intersect(rect<_dest_t, _dest_rt, _dest_it>& o) {
	adjust_to_concept(), o.adjust_to_concept(); 
	if ((_t)o._x0 > _x0) _x0 = (_t)o._x0; 
	if ((_t)o._x1 < _x1) _x1 = (_t)o._x1; 
	if ((_t)o._y0 > _y0) _y0 = (_t)o._y0; 
	if ((_t)o._y1 < _y1) _y1 = (_t)o._y1; 
	return true; 
}
Esempio n. 2
0
bool rect<_t, _rt, _it>::_union(rect<_dest_t, _dest_rt, _dest_it>& o) {
	adjust_to_concept(), o.adjust_to_concept(); 
	if ((_t)o._x0 < _x0) _x0 = (_t)o._x0; 
	if ((_t)o._x1 > _x1) _x1 = (_t)o._x1; 
	if ((_t)o._y0 < _y0) _y0 = (_t)o._y0; 
	if ((_t)o._y1 > _y1) _y1 = (_t)o._y1; 
	return true; 
}
Esempio n. 3
0
bool rect<_t, _rt, _it>::_subtract(rect<_dest_t, _dest_rt, _dest_it>& o, bool shrink) {
	adjust_to_concept(), o.adjust_to_concept(); 
	if (_auto_adjust) adjust_ltrb(); 
	if (shrink) {
		// prefer to smaller
	} else {
		// prefer to bigger
	}
	// 相减时参数有:大优先、小优先、挖空不算、等等,
	// 这是一个非常复杂的分析过程。 xor 也同理。值得以后仔细研究
	return true; 
}
Esempio n. 4
0
bool rect<_t, _rt, _it>::_xor(rect<_dest_t, _dest_rt, _dest_it>& o) {
	adjust_to_concept(), o.adjust_to_concept(); 
	return true; 
}