Pretty much explained what it should work like val. You did provide a useful piece of info, that inverting the coordinates results in nothing being drawn. That makes sense given unless you tell Direct3D you want two-sided rendering, it will only draw the front side (which is determined by winding order). So that piece of info tells me EQ is drawing the entire UI with one-side rendering, which save me from having to dig through a graphics debug spew to find the UI draw calls and what state they have set.
Here's the code as it stands now in EQIA for dealing with the size/location. It's the order I'm most worried about.
Just so you can read this, I use short-hand if's in this code which have the format 'condition ? true-side : false-side'
Code:
Rectangle dest = new Rectangle();
if (RelativePosition)
{
int left = 0, right = 0, top = 0, bottom = 0;
if (AutoStretch)
{
// anchored all the way around?
left = LeftAnchorToLeft ?
parentRectangle.Left + LeftAnchorOffset :
parentRectangle.Right - LeftAnchorOffset;
right = RightAnchorToLeft ?
parentRectangle.Left + RightAnchorOffset :
parentRectangle.Right - RightAnchorOffset;
top = TopAnchorToTop ?
parentRectangle.Top + TopAnchorOffset :
parentRectangle.Bottom - TopAnchorOffset;
bottom = BottomAnchorToTop ?
parentRectangle.Top + BottomAnchorOffset :
parentRectangle.Bottom - BottomAnchorOffset;
}
else
{
if (AutoStretchHorizontal)
{
// anchored X and Width
left = LeftAnchorToLeft ?
parentRectangle.Left + LeftAnchorOffset :
parentRectangle.Right - LeftAnchorOffset;
right = RightAnchorToLeft ?
parentRectangle.Left + RightAnchorOffset :
parentRectangle.Right - RightAnchorOffset;
}
else
{
// relative X and Width
left = parentRectangle.Left + Location.X;
right = left + Size.Width;
}
if (AutoStretchVertical)
{
// anchored Y and Height
top = TopAnchorToTop ?
parentRectangle.Top + TopAnchorOffset :
parentRectangle.Bottom - TopAnchorOffset;
bottom = BottomAnchorToTop ?
parentRectangle.Top + BottomAnchorOffset :
parentRectangle.Bottom - BottomAnchorOffset;
}
else
{
// relative Y and Height
top = parentRectangle.Top + Location.Y;
bottom = top + Size.Height;
}
}
dest = new Rectangle(left, top, right - left, bottom - top);
}
else
{
// absolute location and size
dest.X = Location.X;
dest.Y = Location.Y;
dest.Width = Size.Width;
dest.Height = Size.Height;
}