From 5bdb33899640e8fbd590afa1db6261dc8fb3434a Mon Sep 17 00:00:00 2001 From: MarcinZiabek Date: Tue, 16 Aug 2022 16:25:39 +0200 Subject: [PATCH] Fixed: default text style does not always work --- QuestPDF/Infrastructure/TextStyle.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/QuestPDF/Infrastructure/TextStyle.cs b/QuestPDF/Infrastructure/TextStyle.cs index f5048b8..8eb91f9 100644 --- a/QuestPDF/Infrastructure/TextStyle.cs +++ b/QuestPDF/Infrastructure/TextStyle.cs @@ -40,10 +40,8 @@ namespace QuestPDF.Infrastructure WrapAnywhere = false }; - // REVIEW: Should this be a method call that news up a TextStyle, - // or can it be a static variable? - // (style mutations seem to create a clone anyway) - public static readonly TextStyle Default = new TextStyle(); + // it is important to create new instances for the DefaultTextStyle element to work correctly + public static TextStyle Default => new TextStyle(); internal void ApplyGlobalStyle(TextStyle globalStyle) {