Exemple #1
0
        public void RenderLineArea(LineArea area)
        {
            int rx = this.currentAreaContainerXPosition + area.getStartIndent();
            int ry = this.currentYPosition;
            int w  = area.getContentWidth();
            int h  = area.GetHeight();

            this.currentYPosition -= area.getPlacementOffset();
            this.currentXPosition  = rx;

            int bl = this.currentYPosition;

            foreach (Box b in area.getChildren())
            {
                if (b is InlineArea)
                {
                    InlineArea ia = (InlineArea)b;
                    this.currentYPosition = ry - ia.getYOffset();
                }
                else
                {
                    this.currentYPosition = ry - area.getPlacementOffset();
                }
                b.render(this);
            }

            this.currentYPosition = ry - h;
            this.currentXPosition = rx;
        }
Exemple #2
0
 public LinkedRectangle(Rectangle link, LineArea lineArea,
                        InlineArea inlineArea)
 {
     this.link       = link;
     this.lineArea   = lineArea;
     this.inlineArea = inlineArea;
 }
Exemple #3
0
        public void addRect(Rectangle r, LineArea lineArea, InlineArea inlineArea)
        {
            LinkedRectangle linkedRectangle = new LinkedRectangle(r, lineArea, inlineArea);

            linkedRectangle.setY(this.yoffset);
            if (this.yoffset > maxY)
            {
                maxY = this.yoffset;
            }
            rects.Add(linkedRectangle);
        }
Exemple #4
0
 public void addInlineArea(InlineArea box, LinkSet ls)
 {
     addPending();
     addChild(box);
     if (ls != null)
     {
         Rectangle lr = new Rectangle(finalWidth, 0, box.getContentWidth(), box.getContentHeight());
         ls.addRect(lr, this, box);
     }
     prev        = TEXT;
     finalWidth += box.getContentWidth();
 }
Exemple #5
0
        public void verticalAlign()
        {
            int superHeight = -this.placementOffset;
            int maxHeight   = this.allocationHeight;

            foreach (Box b in children)
            {
                if (b is InlineArea)
                {
                    InlineArea ia = (InlineArea)b;
                    if (ia is WordArea)
                    {
                        ia.setYOffset(placementOffset);
                    }
                    if (ia.GetHeight() > maxHeight)
                    {
                        maxHeight = ia.GetHeight();
                    }
                    switch (ia.getVerticalAlign())
                    {
                    default: break;

                    case VerticalAlign.SUPER:
                    {
                        int fh = fontState.Ascender;
                        ia.setYOffset((int)(placementOffset - (2 * fh / 3.0)));
                    }
                    break;

                    case VerticalAlign.SUB:
                    {
                        int fh = fontState.Ascender;
                        ia.setYOffset((int)(placementOffset + (2 * fh / 3.0)));
                    }
                    break;
                    }
                }
                else
                {
                }
            }
            this.allocationHeight = maxHeight;
        }
Exemple #6
0
 public void setLineArea(InlineArea inlineArea)
 {
     this.inlineArea = inlineArea;
 }
Exemple #7
0
 public LinkedRectangle(LinkedRectangle lr)
 {
     this.link       = lr.getRectangle();
     this.lineArea   = lr.getLineArea();
     this.inlineArea = lr.getInlineArea();
 }