From 3dd8513e42e39378a789c4ba82240df5a834cf50 Mon Sep 17 00:00:00 2001 From: MarcinZiabek Date: Tue, 20 Apr 2021 12:54:38 +0200 Subject: [PATCH] Code cleanup --- QuestPDF/Elements/Debug.cs | 3 ++- QuestPDF/Fluent/ElementExtensions.cs | 1 - QuestPDF/Helpers/Placeholders.cs | 6 +++++- QuestPDF/QuestPDF.csproj | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/QuestPDF/Elements/Debug.cs b/QuestPDF/Elements/Debug.cs index d321856..e1b7e6a 100644 --- a/QuestPDF/Elements/Debug.cs +++ b/QuestPDF/Elements/Debug.cs @@ -13,7 +13,7 @@ namespace QuestPDF.Elements public string Color { get; set; } = Colors.Red.Medium; public void Compose(IContainer container) { - var backgroundColor = SKColor.Parse(Color).WithAlpha(75).ToString(); + var backgroundColor = SKColor.Parse(Color).WithAlpha(50).ToString(); container .Border(1) @@ -26,6 +26,7 @@ namespace QuestPDF.Elements layers .Layer() .ShowIf(!string.IsNullOrWhiteSpace(Text)) + .AlignCenter() .Box() .Background(Colors.White) .Padding(2) diff --git a/QuestPDF/Fluent/ElementExtensions.cs b/QuestPDF/Fluent/ElementExtensions.cs index 1702dbf..10b080b 100644 --- a/QuestPDF/Fluent/ElementExtensions.cs +++ b/QuestPDF/Fluent/ElementExtensions.cs @@ -1,7 +1,6 @@ using System; using QuestPDF.Drawing.Exceptions; using QuestPDF.Elements; -using QuestPDF.Helpers; using QuestPDF.Infrastructure; namespace QuestPDF.Fluent diff --git a/QuestPDF/Helpers/Placeholders.cs b/QuestPDF/Helpers/Placeholders.cs index c7e7bec..8289799 100644 --- a/QuestPDF/Helpers/Placeholders.cs +++ b/QuestPDF/Helpers/Placeholders.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using QuestPDF.Drawing; using QuestPDF.Infrastructure; using SkiaSharp; @@ -211,6 +210,11 @@ namespace QuestPDF.Helpers var index = Random.Next(0, colors.Length); return colors[index]; } + + public static byte[] Image(int width, int height) + { + return Image(new Size(width, height)); + } public static byte[] Image(Size size) { diff --git a/QuestPDF/QuestPDF.csproj b/QuestPDF/QuestPDF.csproj index 0c2854e..7c94afe 100644 --- a/QuestPDF/QuestPDF.csproj +++ b/QuestPDF/QuestPDF.csproj @@ -27,6 +27,7 @@ + true