Пример #1
0
        public void RenderAreaContainer(AreaContainer area) {
            int saveY = this.currentYPosition;
            int saveX = this.currentAreaContainerXPosition;

            if (area.getPosition() == Position.ABSOLUTE) {
                // XPosition and YPosition give the content rectangle position
                this.currentYPosition = area.GetYPosition();
                this.currentAreaContainerXPosition = area.getXPosition();
            }
            else if (area.getPosition() == Position.RELATIVE) {
                this.currentYPosition -= area.GetYPosition();
                this.currentAreaContainerXPosition += area.getXPosition();
            }
            else if (area.getPosition() == Position.STATIC) {
                this.currentYPosition -= area.getPaddingTop()
                    + area.getBorderTopWidth();
            }

            this.currentXPosition = this.currentAreaContainerXPosition;
            DoFrame(area);

            foreach (Box b in area.getChildren()) {
                b.render(this);
            }

            // Restore previous origin
            this.currentYPosition = saveY;
            this.currentAreaContainerXPosition = saveX;
            if (area.getPosition() == Position.STATIC) {
                this.currentYPosition -= area.GetHeight();
            }
        }