float CoordConverter::getBaseXValue(const Window& window)
	{
		const float parent_width = window.getParentPixelWidth();
		float baseX = window.getParent() ? getBaseXValue(*window.getParent()) : 0;

		baseX += window.getArea().d_min.d_x.asAbsolute(parent_width);

		return baseX;
	}
float CoordConverter::screenToWindowX(const Window& window, const float x)
{
    return x - getBaseXValue(window);
}
float CoordConverter::screenToWindowX(const Window& window, const UDim& x)
{
    return asAbsolute(x,
        window.getRootContainerSize().d_width) - getBaseXValue(window);
}
Vector2f CoordConverter::getBaseValue(const Window& window)
{
    return Vector2f(getBaseXValue(window), getBaseYValue(window));
}
	float CoordConverter::windowToScreenX(const Window& window, const UDim& x)
	{
		return getBaseXValue(window) + x.asAbsolute(window.getPixelSize().d_width);
	}
	float CoordConverter::windowToScreenX(const Window& window, const float x)
	{
		return getBaseXValue(window) + x;
	}
	float CoordConverter::screenToWindowX(const Window& window, const UDim& x)
	{
		return x.asAbsolute(System::getSingleton().getRenderer()->getWidth()) -
			getBaseXValue(window);
	}