Skip to content

Commit

Permalink
Enhanced: Improved the visual quality of the underline text decoratio…
Browse files Browse the repository at this point in the history
…n (gaps)
  • Loading branch information
MarcinZiabek committed May 23, 2024
1 parent 2bd348c commit bdfd7c6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Source/QuestPDF/Infrastructure/TextStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ internal SkTextStyle GetSkTextStyle()
DecorationColor = DecorationColor ?? Colors.Black,
DecorationType = CreateDecoration(),

DecorationMode = TextStyleConfiguration.TextDecorationMode.Through,
DecorationMode = GetDecorationMode(),
DecorationStyle = DecorationStyle ?? TextStyleConfiguration.TextDecorationStyle.Solid,
DecorationThickness = DecorationThickness ?? 1,

Expand All @@ -108,6 +108,14 @@ IntPtr[] GetFontFamilyPointers(IList<SkText> texts)

return result;
}

TextStyleConfiguration.TextDecorationMode GetDecorationMode()
{
if (HasUnderline == true)
return TextStyleConfiguration.TextDecorationMode.Gaps;

return TextStyleConfiguration.TextDecorationMode.Through;
}

TextStyleConfiguration.TextDecoration CreateDecoration()
{
Expand Down

0 comments on commit bdfd7c6

Please sign in to comment.