55 lines
1.6 KiB
C#
55 lines
1.6 KiB
C#
![]() |
using System;
|
|||
|
using CPF.ReoGrid.Graphics;
|
|||
|
using CPF.ReoGrid.Views;
|
|||
|
|
|||
|
namespace CPF.ReoGrid.Rendering
|
|||
|
{
|
|||
|
public sealed class CellDrawingContext : RDrawingContext
|
|||
|
{
|
|||
|
public Cell Cell { get; set; }
|
|||
|
|
|||
|
internal bool AllowCellClip { get; set; }
|
|||
|
|
|||
|
internal bool FullCellClip { get; set; }
|
|||
|
|
|||
|
public void DrawCellText()
|
|||
|
{
|
|||
|
bool flag = base.CurrentView is CellsViewport && this.Cell != null && !string.IsNullOrEmpty(this.Cell.DisplayText);
|
|||
|
if (flag)
|
|||
|
{
|
|||
|
CellsViewport cellsViewport = (CellsViewport)base.CurrentView;
|
|||
|
IGraphics graphics = base.Graphics;
|
|||
|
float renderScaleFactor = base.Worksheet.renderScaleFactor;
|
|||
|
graphics.PopTransform();
|
|||
|
cellsViewport.DrawCellText(this, this.Cell);
|
|||
|
graphics.PushTransform();
|
|||
|
bool flag2 = renderScaleFactor != 1f;
|
|||
|
if (flag2)
|
|||
|
{
|
|||
|
graphics.ScaleTransform(renderScaleFactor, renderScaleFactor);
|
|||
|
}
|
|||
|
graphics.TranslateTransform(this.Cell.Left, this.Cell.Top);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void DrawCellBackground()
|
|||
|
{
|
|||
|
bool flag = base.CurrentView is CellsViewport && this.Cell != null;
|
|||
|
if (flag)
|
|||
|
{
|
|||
|
CellsViewport cellsViewport = (CellsViewport)base.CurrentView;
|
|||
|
cellsViewport.DrawCellBackground(this, this.Cell.InternalRow, this.Cell.InternalCol, this.Cell, true);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
internal CellDrawingContext(Worksheet worksheet, DrawMode drawMode) : this(worksheet, drawMode, null)
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
internal CellDrawingContext(Worksheet worksheet, DrawMode drawMode, IRenderer r) : base(worksheet, drawMode, r)
|
|||
|
{
|
|||
|
this.AllowCellClip = !worksheet.HasSettings(WorksheetSettings.View_AllowCellTextOverflow);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|