Browse Source

Consolidated classes for Row and Grid elements

MarcinZiabek 4 years ago
parent
commit
950d971119

+ 6 - 0
QuestPDF/Elements/Grid.cs

@@ -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;

+ 0 - 10
QuestPDF/Elements/GridElement.cs

@@ -1,10 +0,0 @@
-using QuestPDF.Infrastructure;
-
-namespace QuestPDF.Elements
-{
-    internal class GridElement
-    {
-        public int Columns { get; set; } = 1;
-        public Element? Child { get; set; }
-    }
-}

+ 26 - 0
QuestPDF/Elements/Row.cs

@@ -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>();

+ 0 - 30
QuestPDF/Elements/RowElement.cs

@@ -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;
-        }
-    }
-}