Improved default behavior of fluent configuration

This commit is contained in:
Marcin Ziąbek
2022-01-08 01:11:25 +01:00
parent ba8b35b1c0
commit a2ce31022c
4 changed files with 10 additions and 15 deletions
+4 -4
View File
@@ -31,22 +31,22 @@ namespace QuestPDF.Fluent
public static IContainer PaddingTop(this IContainer element, float value)
{
return element.Padding(x => x.Top = value);
return element.Padding(x => x.Top += value);
}
public static IContainer PaddingBottom(this IContainer element, float value)
{
return element.Padding(x => x.Bottom = value);
return element.Padding(x => x.Bottom += value);
}
public static IContainer PaddingLeft(this IContainer element, float value)
{
return element.Padding(x => x.Left = value);
return element.Padding(x => x.Left += value);
}
public static IContainer PaddingRight(this IContainer element, float value)
{
return element.Padding(x => x.Right = value);
return element.Padding(x => x.Right += value);
}
}
}
+2 -2
View File
@@ -21,7 +21,7 @@ namespace QuestPDF.Fluent
public static IContainer ScaleHorizontal(this IContainer element, float value)
{
return element.Scale(x => x.ScaleX = value);
return element.Scale(x => x.ScaleX *= value);
}
public static IContainer FlipHorizontal(this IContainer element)
@@ -31,7 +31,7 @@ namespace QuestPDF.Fluent
public static IContainer ScaleVertical(this IContainer element, float value)
{
return element.Scale(x => x.ScaleY = value);
return element.Scale(x => x.ScaleY *= value);
}
public static IContainer FlipVertical(this IContainer element)
+2 -2
View File
@@ -16,12 +16,12 @@ namespace QuestPDF.Fluent
public static IContainer TranslateX(this IContainer element, float value)
{
return element.Translate(x => x.TranslateX = value);
return element.Translate(x => x.TranslateX += value);
}
public static IContainer TranslateY(this IContainer element, float value)
{
return element.Translate(x => x.TranslateY = value);
return element.Translate(x => x.TranslateY += value);
}
}
}
+2 -7
View File
@@ -1,7 +1,2 @@
Introduced new element: `Table` - a great way to construct complex document structures, e.g. reports. This element covers all cases offered by combination of the `Stack` and the `Row` elements. Additionally, it provides support for more complex layouts and corner cases. Updating to the `Table` element can greatly simplify your code 😁
Other changes:
- Added new element `DefaultTextStyle` - it allows set new text style to all its children,
- Improved the default paging behavior for the `Row` element. In some minor corner cases it might cause infinite layout exceptions and confuse developers.
- Improved the `Row` element: added new type of column that combines constant and relative widths.
- Fixed default page sizes for: Letter and Legal.
- Added a `ScaleToFit` element - scales it child down so it does fit in the provided space,
- Improved default Fluent configuration behavior for elements: Scale, Padding, Translate.