Browse Source

Fixed breaking long words

MarcinZiabek 3 years ago
parent
commit
4da3ef5dfa

+ 2 - 2
QuestPDF.Examples/TableBenchmark.cs

@@ -16,7 +16,7 @@ namespace QuestPDF.Examples
                 .ProducePdf()
                 .ProducePdf()
                 .PageSize(PageSizes.A4)
                 .PageSize(PageSizes.A4)
                 .ShowResults()
                 .ShowResults()
-                .MaxPages(20_000)
+                .MaxPages(10_000)
                 .EnableCaching(true)
                 .EnableCaching(true)
                 .EnableDebugging(false)
                 .EnableDebugging(false)
                 .Render(container =>
                 .Render(container =>
@@ -27,7 +27,7 @@ namespace QuestPDF.Examples
                         .Border(1)
                         .Border(1)
                         .Table(table =>
                         .Table(table =>
                         {
                         {
-                            const int numberOfRows = 250_000;
+                            const int numberOfRows = 100_000;
                             const int numberOfColumns = 10;
                             const int numberOfColumns = 10;
                             
                             
                             table.ColumnsDefinition(columns =>
                             table.ColumnsDefinition(columns =>

+ 1 - 1
QuestPDF.Examples/TextExamples.cs

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

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

@@ -119,7 +119,7 @@ namespace QuestPDF.Elements.Text.Items
             // there is no available space to wrap text
             // there is no available space to wrap text
             // if the item is first within the line, perform safe mode and chop the word
             // if the item is first within the line, perform safe mode and chop the word
             // otherwise, move the item into the next line
             // otherwise, move the item into the next line
-            return isFirstElementInLine ? (textLength, textLength + 1) : null;
+            return isFirstElementInLine ? (textLength, textLength) : null;
         }
         }
         
         
         public virtual void Draw(TextDrawingRequest request)
         public virtual void Draw(TextDrawingRequest request)