Consolidated classes for Row and Grid elements
This commit is contained in:
@@ -6,6 +6,12 @@ using static QuestPDF.Infrastructure.HorizontalAlignment;
|
||||
|
||||
namespace QuestPDF.Elements
|
||||
{
|
||||
internal class GridElement
|
||||
{
|
||||
public int Columns { get; set; } = 1;
|
||||
public Element? Child { get; set; }
|
||||
}
|
||||
|
||||
internal class Grid : IComponent
|
||||
{
|
||||
public const int DefaultColumnsCount = 12;
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
using QuestPDF.Infrastructure;
|
||||
|
||||
namespace QuestPDF.Elements
|
||||
{
|
||||
internal class GridElement
|
||||
{
|
||||
public int Columns { get; set; } = 1;
|
||||
public Element? Child { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,32 @@ using QuestPDF.Infrastructure;
|
||||
|
||||
namespace QuestPDF.Elements
|
||||
{
|
||||
internal abstract class RowElement : ContainerElement
|
||||
{
|
||||
public float Width { get; set; } = 1;
|
||||
|
||||
internal override void Draw(ICanvas canvas, Size availableSpace)
|
||||
{
|
||||
Child?.Draw(canvas, availableSpace);
|
||||
}
|
||||
}
|
||||
|
||||
internal class ConstantRowElement : RowElement
|
||||
{
|
||||
public ConstantRowElement(float width)
|
||||
{
|
||||
Width = width;
|
||||
}
|
||||
}
|
||||
|
||||
internal class RelativeRowElement : RowElement
|
||||
{
|
||||
public RelativeRowElement(float width)
|
||||
{
|
||||
Width = width;
|
||||
}
|
||||
}
|
||||
|
||||
internal class Row : Element
|
||||
{
|
||||
public List<RowElement> Children { get; set; } = new List<RowElement>();
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
using QuestPDF.Infrastructure;
|
||||
|
||||
namespace QuestPDF.Elements
|
||||
{
|
||||
internal abstract class RowElement : ContainerElement
|
||||
{
|
||||
public float Width { get; set; } = 1;
|
||||
|
||||
internal override void Draw(ICanvas canvas, Size availableSpace)
|
||||
{
|
||||
Child?.Draw(canvas, availableSpace);
|
||||
}
|
||||
}
|
||||
|
||||
internal class ConstantRowElement : RowElement
|
||||
{
|
||||
public ConstantRowElement(float width)
|
||||
{
|
||||
Width = width;
|
||||
}
|
||||
}
|
||||
|
||||
internal class RelativeRowElement : RowElement
|
||||
{
|
||||
public RelativeRowElement(float width)
|
||||
{
|
||||
Width = width;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user