Skip to content

fix(skia): Give empty RichTextBlock lines the default font's line height (fixes #26395) - #26687

Open
seragAhmed wants to merge 1 commit into
unoplatform:masterfrom
seragAhmed:fix/26395-empty-richtextblock-line-height
Open

seragAhmed wants to merge 1 commit into
unoplatform:masterfrom
seragAhmed:fix/26395-empty-richtextblock-line-height

Conversation

@seragAhmed

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #26395

PR Type:

🐞 Bugfix

What changed? 🚀

On Skia, an empty RichTextBlock, an empty Paragraph, or the line after a trailing LineBreak was FontSize tall instead of one line tall, as in WinUI.

ParagraphTextSource.DefaultLineHeight returned the owner's FontSize. It now returns the line height of the paragraph's default font (FontDetails.LineHeight), resolved like GetParagraphProperties does. This is the same metric a line with text uses, and it matches WinUI's LsTextLine::CalculateLineMetrics for empty lines. It also uses the paragraph's own font rather than always the owner's.

Validation

  • New runtime test Given_RichTextBlock.When_Empty_Height_Matches_One_Line (FontSize 14 and 40): no blocks, an empty paragraph, and a trailing LineBreak are one and two lines tall.
  • All 187 Given_RichTextBlock tests pass on Skia Desktop (net11.0-desktop).

Not handled here: TextLineBounds for empty lines (mentioned in the issue as something to check).

PR Checklist ✅

  • 🧪 Added Runtime tests
  • 📚 Docs
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@mergify

mergify Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request once it meets the queue conditions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty RichTextBlock and empty Paragraph are FontSize tall instead of one line high (Skia)

1 participant