Exemplo n.º 1
0
        public RectangleF GetCellRect(CellCoord cellCoord)
        {
            SpanOffset?span = GetCellSpan(cellCoord.rowIdx, cellCoord.colIdx);

            if (span == null)
            {
                return(GetOriginalCellRect(cellCoord));
            }

            SpanOffset _span = span.Value;


            int        rowIdx = cellCoord.rowIdx - _span.top;
            int        colIdx = cellCoord.colIdx - _span.left;
            RectangleF r1     = GetOriginalCellRect(rowIdx, colIdx);

            rowIdx = cellCoord.rowIdx + _span.bottom;
            colIdx = cellCoord.colIdx + _span.right;
            RectangleF r2 = GetOriginalCellRect(rowIdx, colIdx);


            RectangleF rect = new RectangleF(r1.Left, r1.Top, r2.Right - r1.Left, r2.Bottom - r1.Top);

            return(rect);
        }
Exemplo n.º 2
0
        public void SetCellSpan(int rowIdx, int colIdx, SpanOffset span)
        {
            int key = GetRowColKey(rowIdx, colIdx);

            if (cellSpanDict.ContainsKey(key) == false)
            {
                cellSpanDict.Add(key, span);
            }

            cellSpanDict[key] = span;
        }