예제 #1
0
	Rect CoordConverter::screenToWindow(const Window& window, const URect& rect)
	{
		Vector2 base(getBaseValue(window));
		Rect pixel(rect.asAbsolute(System::getSingleton().getRenderer()->getSize()));

		// negate base position
		base.d_x = -base.d_x;
		base.d_y = -base.d_y;

		return pixel.offset(base);
	}
예제 #2
0
	Rect CoordConverter::windowToScreen(const Window& window, const URect& rect)
	{
		Rect tmp(rect.asAbsolute(window.getPixelSize()));
		return tmp.offset(getBaseValue(window));
	}