public void SetCellSpan(int rowIdx, int colIdx, SpanOffset span) { string key = GetRowColKey(rowIdx, colIdx); if (cellSpanDict.ContainsKey(key) == false) { cellSpanDict.Add(key, span); } cellSpanDict[key] = span; }
public RectangleF GetCellRect(CellCoord cellCoord) { SpanOffset span = GetCellSpan(cellCoord.rowIdx, cellCoord.colIdx); if (span == null) { return(GetOriginalCellRect(cellCoord)); } 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); }