Esempio n. 1
0
        public void Render(DrawBoard d, UpdateArea updateArea)
        {
            LinkedListNode <RenderElement> node = _linkList.First;
            Rectangle backup         = updateArea.CurrentRect;
            int       enter_canvas_x = d.OriginX;
            int       enter_canvas_y = d.OriginY;

            while (node != null)
            {
                //---------------------------
                //TODO: review here again
                RenderElement renderE = node.Value;
                if (renderE.IntersectsWith(updateArea))
                {
                    int x = renderE.X;
                    int y = renderE.Y;

                    d.SetCanvasOrigin(enter_canvas_x + x, enter_canvas_y + y);
                    updateArea.Offset(-x, -y);
                    RenderElement.Render(renderE, d, updateArea);
                    updateArea.Offset(x, y);
                }

                node = node.Next;
            }
            updateArea.CurrentRect = backup;                   //restore
            d.SetCanvasOrigin(enter_canvas_x, enter_canvas_y); //restore
        }