Skip to content

Commit 6bca16c

Browse files
Update tests to reflect Fonts fixes
1 parent 536697e commit 6bca16c

5 files changed

+12
-12
lines changed

tests/ImageSharp.Drawing.Tests/Drawing/Text/DrawTextOnImageTests.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,8 @@ public void CanRotateFilledFont_Issue175<TPixel>(
451451
AffineTransformBuilder builder = new AffineTransformBuilder().AppendRotationDegrees(angle);
452452

453453
RichTextOptions textOptions = new(font);
454-
FontRectangle bounds = TextMeasurer.MeasureSize(text, textOptions);
455-
Matrix3x2 transform = builder.BuildMatrix(Rectangle.Round(new RectangleF(bounds.X, bounds.Y, bounds.Width, bounds.Height)));
454+
FontRectangle advance = TextMeasurer.MeasureAdvance(text, textOptions);
455+
Matrix3x2 transform = builder.BuildMatrix(Rectangle.Round(new RectangleF(advance.X, advance.Y, advance.Width, advance.Height)));
456456

457457
provider.RunValidatingProcessorTest(
458458
x => x.SetDrawingTransform(transform).DrawText(textOptions, text, Color.Black),
@@ -478,8 +478,8 @@ public void CanRotateOutlineFont_Issue175<TPixel>(
478478
AffineTransformBuilder builder = new AffineTransformBuilder().AppendRotationDegrees(angle);
479479

480480
RichTextOptions textOptions = new(font);
481-
FontRectangle bounds = TextMeasurer.MeasureSize(text, textOptions);
482-
Matrix3x2 transform = builder.BuildMatrix(Rectangle.Round(new RectangleF(bounds.X, bounds.Y, bounds.Width, bounds.Height)));
481+
FontRectangle advance = TextMeasurer.MeasureAdvance(text, textOptions);
482+
Matrix3x2 transform = builder.BuildMatrix(Rectangle.Round(new RectangleF(advance.X, advance.Y, advance.Width, advance.Height)));
483483

484484
provider.RunValidatingProcessorTest(
485485
x => x.SetDrawingTransform(transform)

0 commit comments

Comments
 (0)