当前位置: 首页>>代码示例>>C++>>正文


C++ rect::bottom方法代码示例

本文整理汇总了C++中rect::bottom方法的典型用法代码示例。如果您正苦于以下问题:C++ rect::bottom方法的具体用法?C++ rect::bottom怎么用?C++ rect::bottom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rect的用法示例。


在下文中一共展示了rect::bottom方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: clop

  inline pos2<T> clop(const pos2<T>& pos, const rect<T>& r, T resolution=1) {
	pos2<T> cloped(pos);
	if (cloped.x_ >= r.right()) cloped.x_ = r.right() - resolution;
	if (cloped.y_ >= r.bottom()) cloped.y_ = r.bottom() - resolution;
	if (cloped.x_ < r.left()) cloped.x_ = r.left();
	if (cloped.y_ < r.top()) cloped.y_ = r.top();
	return cloped;
  }
开发者ID:venkatarajasekhar,项目名称:ssa,代码行数:8,代码来源:rect.hpp

示例2: contains

	constexpr bool contains(
		rect< PositionType, SizeType > const& reference,
		rect< PositionType, SizeType > const& test
	){
		return
			test.left()   >= reference.left()  &&
			test.top()    >= reference.top()   &&
			test.right()  <= reference.right() &&
			test.bottom() <= reference.bottom();
	}
开发者ID:bebuch,项目名称:disposer_module,代码行数:10,代码来源:rect.hpp

示例3: join

	constexpr rect< PositionType, SizeType > join(
		rect< PositionType, SizeType > const& lhs,
		rect< PositionType, SizeType > const& rhs
	){
		return rect< PositionType, SizeType >(
			point< PositionType >(
				std::min(lhs.left(), rhs.left()),
				std::min(lhs.top(), rhs.top())
			),
			point< PositionType >(
				std::max(lhs.right(), rhs.right()),
				std::max(lhs.bottom(), rhs.bottom())
			)
		);
	}
开发者ID:bebuch,项目名称:disposer_module,代码行数:15,代码来源:rect.hpp

示例4: hit_test

	int rect::hit_test(const rect& other) const
	{
		int intersect_other = 0;
		if (other.hit_test(left(),  top()))		intersect_other++;
		if (other.hit_test(left(),  bottom()))	intersect_other++;
		if (other.hit_test(right(), top()))		intersect_other++;
		if (other.hit_test(right(), bottom()))	intersect_other++;

		if (intersect_other == 0)
			return outside;
		else if (intersect_other == 4)
			return inside;

		intersect_other = 0;
		if (hit_test(other.left(),  other.top()))		intersect_other++;
		if (hit_test(other.left(),  other.bottom()))	intersect_other++;
		if (hit_test(other.right(), other.top()))		intersect_other++;
		if (hit_test(other.right(), other.bottom()))	intersect_other++;

		if (intersect_other == 4)
			return contain;
		else //
			return intersect;
	}
开发者ID:zxiy,项目名称:gml,代码行数:24,代码来源:rect.cpp


注:本文中的rect::bottom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。