public virtual void OnDraw() { for (int i = 0; i < m_Children.Count; i++) { GUIWidget <T> child = m_Children[i]; if (child.Visible) { GetRenderer().PushTransform(); //Affine transform = GetRenderer().GetTransform(); //transform *= child.GetTransform(); IAffineTransformMatrix <T> transform = GetRenderer().GetTransform(); transform = MatrixFactory <T> .CreateAffine(transform.Multiply(child.GetTransform())); //transform *= child.GetTransform(); GetRenderer().SetTransform(transform); child.OnDraw(); #if false if (Focused) { RoundedRect rect = new RoundedRect(-5, -5, 5, 5, 0); GetRenderer().Render(rect, new RGBA_Bytes(1.0, 0, 0, .5)); } #endif GetRenderer().PopTransform(); } } }
public void RectToScreen(ref RectDouble <T> clientRect) { GUIWidget <T> prevGUIWidget = this; while (prevGUIWidget != null) { prevGUIWidget.GetTransform().Transform(ref clientRect); prevGUIWidget = prevGUIWidget.Parrent; } }
public void PointToScreen(ref IVector <T> clientPoint) { GUIWidget <T> prevGUIWidget = this; while (prevGUIWidget != null) { prevGUIWidget.GetTransform().Transform(ref clientPoint); prevGUIWidget = prevGUIWidget.Parrent; } }
public void PointToClient(ref T screenPointX, ref T screenPointY) { GUIWidget <T> curGUIWidget = this; while (curGUIWidget != null) { curGUIWidget.GetTransform().Inverse.Transform(ref screenPointX, ref screenPointY); curGUIWidget = curGUIWidget.Parrent; } }