Пример #1
0
 public void Draw(string FocusedElementKey, UIRenderer UIRendererInstance)
 {
     if (IsScrollable)
     {
         int innerHeight = 0;
         foreach (UIDrawCall child in ChildDrawCalls)
         {
             innerHeight += child.Height + child.Element.GetHeight().FullMargin;
         }
         int scroll = MathHelper.Clamp(Element.GetScroll(), 0, innerHeight - Height);
         if (scroll != Element.GetScroll())
         {
             Element.SetScroll(scroll);
         }
         UIRendererInstance.EnableScrollingTarget(this);
     }
     Element.Draw(Width, Height, X, Y, Element.GetKey() == FocusedElementKey);
     foreach (UIDrawCall child in ChildDrawCalls)
     {
         child.Draw(FocusedElementKey, UIRendererInstance);
     }
     if (IsScrollable)
     {
         UIRendererInstance.FlipScrollingTarget(this);
     }
 }