Example #1
0
        internal static void BeginFrame(LGuiFrameContext Context, bool IsChild)
        {
            PushID(LGuiHash.CalculateID(Context.Title));
            var ClipRect = FrameContextStack.Count > 0 && IsChild
                ? LGuiMisc.CombineRect(ref GetCurrentFrame().Rect, ref Context.Rect)
                : Context.Rect;

            FrameContextStack.Push(Context);
            LGuiGraphics.SetClipRect(ClipRect);
        }
Example #2
0
        internal static void EndFrame()
        {
            if (FrameContextStack.Count > 0)
            {
                PopID();
                FrameContextStack.Pop();

                if (FrameContextStack.Count > 0)
                {
                    LGuiGraphics.SetClipRect(GetCurrentFrame().Rect);
                }
                else
                {
                    LGuiGraphics.SetClipRect(new LGuiRect(LGuiVec2.Zero, IO.DisplaySize));
                }
            }
        }