Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix character bounds returned by TryMeasureCharacterBounds #398

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

gerdus
Copy link
Contributor

@gerdus gerdus commented Mar 24, 2024

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

refer #397

There was a new test failure in GlyphTests - EmojiWidthIsComputedCorrectlyWithSubstitutionOnZwj
which I fixed by adjusting the test, seems more correct now since it is now the same width with the the substitution.

Copy link

codecov bot commented Mar 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86%. Comparing base (5cfb1fd) to head (91405e3).
Report is 6 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #398   +/-   ##
=====================================
  Coverage     86%     86%           
=====================================
  Files        238     238           
  Lines      15251   15255    +4     
  Branches    2108    2108           
=====================================
+ Hits       13219   13234   +15     
+ Misses      1561    1550   -11     
  Partials     471     471           
Flag Coverage Δ
unittests 86% <100%> (+<1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -100,8 +100,15 @@ namespace SixLabors.Fonts;

internal FontRectangle BoundingBox(float dpi)
{
Vector2 origin = (this.PenLocation + this.Offset) * dpi;
FontRectangle box = this.Glyph.BoundingBox(this.LayoutMode, this.BoxLocation, dpi);
// Same logic as in TrueTypeGlyphMetrics.RenderTo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I'd actually updated this. Obviously not!

Copy link
Member

@JimBobSquarePants JimBobSquarePants left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic! Thanks for your help!

@JimBobSquarePants JimBobSquarePants merged commit e546be3 into SixLabors:main Mar 28, 2024
9 checks passed
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.

2 participants