示例#1
0
        public SpanArea(FontState fontState, int xPosition, int yPosition,
                        int allocationWidth, int maxHeight, int columnCount,
                        int columnGap) :
            base(fontState, xPosition, yPosition, allocationWidth, maxHeight,
                 Position.ABSOLUTE)
        {
            this.contentRectangleWidth = allocationWidth;
            this.columnCount           = columnCount;
            this.columnGap             = columnGap;

            int columnWidth = (allocationWidth - columnGap * (columnCount - 1))
                              / columnCount;

            for (int columnIndex = 0; columnIndex < columnCount; columnIndex++)
            {
                int colXPosition = (xPosition
                                    + columnIndex * (columnWidth + columnGap));
                int        colYPosition = yPosition;
                ColumnArea colArea      = new ColumnArea(fontState, colXPosition,
                                                         colYPosition, columnWidth,
                                                         maxHeight, columnCount);
                addChild(colArea);
                colArea.setColumnIndex(columnIndex + 1);
            }
        }
示例#2
0
文件: SpanArea.cs 项目: nholik/Fo.Net
        public SpanArea(FontState fontState, int xPosition, int yPosition,
                        int allocationWidth, int maxHeight, int columnCount,
                        int columnGap) :
            base(fontState, xPosition, yPosition, allocationWidth, maxHeight,
                                 Position.ABSOLUTE)
        {
            this.contentRectangleWidth = allocationWidth;
            this.columnCount = columnCount;
            this.columnGap = columnGap;

            int columnWidth = (allocationWidth - columnGap * (columnCount - 1))
                / columnCount;
            for (int columnIndex = 0; columnIndex < columnCount; columnIndex++)
            {
                int colXPosition = (xPosition
                    + columnIndex * (columnWidth + columnGap));
                int colYPosition = yPosition;
                ColumnArea colArea = new ColumnArea(fontState, colXPosition,
                                                    colYPosition, columnWidth,
                                                    maxHeight, columnCount);
                addChild(colArea);
                colArea.setColumnIndex(columnIndex + 1);
            }
        }