예제 #1
0
        public override void Refresh()
        {
            double ulx = max_box_size;
            double uly = max_box_size;
            double lrx = 0;
            double lry = 0;

            foreach (PdfBox box in InnerBoxes)
            {
                box.Refresh();
                if (box.AbsRectangle.UpperLeft.X < ulx)
                {
                    ulx = box.AbsRectangle.UpperLeft.X;
                }
                if (box.AbsRectangle.UpperLeft.Y < uly)
                {
                    uly = box.AbsRectangle.UpperLeft.Y;
                }
                if (box.AbsRectangle.LowerRight.X > lrx)
                {
                    lrx = box.AbsRectangle.LowerRight.X;
                }
                if (box.AbsRectangle.LowerRight.Y > lry)
                {
                    lry = box.AbsRectangle.LowerRight.Y;
                }
            }

            UpperLeft  = new PdfXY(ulx - Borders.Left, uly - Borders.Top);
            LowerRight = new PdfXY(lrx + Borders.Right, lry + Borders.Bottom);
            base.Refresh();
        }
예제 #2
0
 public PdfAutoBox(PdfXY upper_left, PdfGrow grow_direction, PdfAlign v_align, PdfArea area, PdfArea max_area = null, PdfBorder borders = null, PdfBoxLayout box_layout = null)
     : base(borders, box_layout)
 {
     UpperLeft     = upper_left;
     GrowDirection = grow_direction;
     VAlign        = v_align;
     Area          = area;
     MaxArea       = max_area ?? new PdfArea(max_box_size, max_box_size);
 }
예제 #3
0
 public PdfAutoBox(PdfXY upper_left, PdfGrow grow_direction, PdfArea area = null, PdfArea max_area = null, PdfBorder borders = null, PdfBoxLayout box_layout = null)
     : this(upper_left, grow_direction, PdfAlign.Far, area ?? new PdfArea(0, 0), max_area, borders, box_layout)
 {
 }