public CustomJournalPage.Table AddColumn(CustomJournalPage.Cell label) { if (rows.Count == 0) { AddRow(); } rows[0].Add(label); return(this); }
public void Render(Vector2 position) { if (Header == null) { return; } float num = 0f; float num2 = 0f; for (int i = 0; i < Header.Count; i++) { num2 += Header[i].Width() + 20f; } for (int j = 0; j < Header.Count; j++) { float num3 = Header[j].Width(); Header[j].Render(position + new Vector2(num + num3 * 0.5f, 40f), num3); int num4 = 1; float num5 = 130f; for (int k = 1; k < rows.Count; k++) { Vector2 vector = position + new Vector2(num + num3 * 0.5f, num5); if (rows[k].Count > 0) { if (num4 % 2 == 0) { Draw.Rect(vector.X - num3 * 0.5f, vector.Y - 27f, num3 + 20f, 54f, Color.Black * 0.08f); } if (j < rows[k].Count && rows[k][j] != null) { CustomJournalPage.Cell cell = rows[k][j]; if (cell.SpreadOverColumns > 1) { for (int l = j + 1; l < j + cell.SpreadOverColumns; l++) { vector.X += Header[l].Width() * 0.5f; } vector.X += (cell.SpreadOverColumns - 1) * 20f * 0.5f; } rows[k][j].Render(vector, num3); } num4++; num5 += 60f; } else { Draw.Rect(vector.X - num3 * 0.5f, vector.Y - 25.5f, num3 + 20f, 6f, Color.Black * 0.3f); num5 += 15f; } } num += num3 + 20f; } }