MarcinZiabek 3 years ago
parent
commit
8732b7e50b

+ 1 - 1
QuestPDF.Examples/TextExamples.cs

@@ -397,7 +397,7 @@ namespace QuestPDF.Examples
                                 text.DefaultTextStyle(x => x.BackgroundColor(Colors.Red.Lighten3).FontSize(24));
                                 
                                 text.Span("       " + Placeholders.LoremIpsum());
-                                text.Span(" 0123456789012345678901234567890123456789012345678901234567890123456789         ").BreakAnywhere();
+                                text.Span(" 0123456789012345678901234567890123456789012345678901234567890123456789         ").WrapAnywhere();
                             });
                         });
                     });

+ 1 - 1
QuestPDF/Elements/Text/Items/TextBlockSpan.cs

@@ -102,7 +102,7 @@ namespace QuestPDF.Elements.Text.Items
                 return (textLength, textLength + 1);
 
             // breaking anywhere
-            if (Style.BreakAnywhere ?? false)
+            if (Style.WrapAnywhere ?? false)
                 return (textLength, textLength);
                 
             // current line ends at word, next character is space, perfect place to wrap

+ 2 - 2
QuestPDF/Fluent/TextSpanDescriptorExtensions.cs

@@ -63,9 +63,9 @@ namespace QuestPDF.Fluent
             return descriptor;
         }
 
-        public static T BreakAnywhere<T>(this T descriptor, bool value = true) where T : TextSpanDescriptor
+        public static T WrapAnywhere<T>(this T descriptor, bool value = true) where T : TextSpanDescriptor
         {
-            descriptor.TextStyle.BreakAnywhere = value;
+            descriptor.TextStyle.WrapAnywhere = value;
             return descriptor;
         }
 

+ 2 - 2
QuestPDF/Fluent/TextStyleExtensions.cs

@@ -72,9 +72,9 @@ namespace QuestPDF.Fluent
             return style.Mutate(x => x.HasUnderline = value);
         }
         
-        public static TextStyle BreakAnywhere(this TextStyle style, bool value = true)
+        public static TextStyle WrapAnywhere(this TextStyle style, bool value = true)
         {
-            return style.Mutate(x => x.BreakAnywhere = value);
+            return style.Mutate(x => x.WrapAnywhere = value);
         }
 
         #region Weight

+ 4 - 4
QuestPDF/Infrastructure/TextStyle.cs

@@ -16,7 +16,7 @@ namespace QuestPDF.Infrastructure
         internal bool? IsItalic { get; set; }
         internal bool? HasStrikethrough { get; set; }
         internal bool? HasUnderline { get; set; }
-        internal bool? BreakAnywhere { get; set; }
+        internal bool? WrapAnywhere { get; set; }
 
         internal object PaintKey { get; private set; }
         internal object FontMetricsKey { get; private set; }
@@ -32,7 +32,7 @@ namespace QuestPDF.Infrastructure
             IsItalic = false,
             HasStrikethrough = false,
             HasUnderline = false,
-            BreakAnywhere = false
+            WrapAnywhere = false
         };
 
         public static TextStyle Default => new TextStyle();
@@ -60,7 +60,7 @@ namespace QuestPDF.Infrastructure
             IsItalic ??= parentStyle.IsItalic;
             HasStrikethrough ??= parentStyle.HasStrikethrough;
             HasUnderline ??= parentStyle.HasUnderline;
-            BreakAnywhere ??= parentStyle.BreakAnywhere;
+            WrapAnywhere ??= parentStyle.WrapAnywhere;
         }
 
         internal void OverrideStyle(TextStyle parentStyle)
@@ -74,7 +74,7 @@ namespace QuestPDF.Infrastructure
             IsItalic = parentStyle.IsItalic ?? IsItalic;
             HasStrikethrough = parentStyle.HasStrikethrough ?? HasStrikethrough;
             HasUnderline = parentStyle.HasUnderline ?? HasUnderline;
-            BreakAnywhere = parentStyle.BreakAnywhere ?? BreakAnywhere;
+            WrapAnywhere = parentStyle.WrapAnywhere ?? WrapAnywhere;
         }
         
         internal TextStyle Clone()