Skip to content

Commit 434ccca

Browse files
committed
fix tests
1 parent aa01c34 commit 434ccca

10 files changed

Lines changed: 6 additions & 2 deletions

src/ImageSharp.Drawing/Processing/Processors/Text/DrawTextProcessor{TPixel}.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,11 @@ public void EndGlyph()
377377

378378
private Buffer2D<float> Render(IPath path)
379379
{
380-
Size size = Rectangle.Ceiling(path.Bounds).Size * 2;
380+
var size = Rectangle.Ceiling(new RectangularPolygon(path.Bounds)
381+
.Transform(this.Options.Transform)
382+
.Bounds)
383+
.Size;
384+
381385
size = new Size(size.Width + (this.offset * 2), size.Height + (this.offset * 2));
382386

383387
int subpixelCount = FillRegionProcessor.MinimumSubpixelCount;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public void FontShapesAreRenderedCorrectly_WithSkewApplied<TPixel>(
227227
})
228228
.SetDrawingTransform(Matrix3x2.CreateSkew(radianX, radianY, new Vector2(rotationOriginX, rotationOriginY)))
229229
.DrawText(text, font, Color.Black, new PointF(x, y)),
230-
$"{fontName}-{fontSize}-{ToTestOutputDisplayText(text)}-({x},{y})-A({angleX},{angleY})",
230+
$"F({fontName})-S({fontSize})-A({angleX},{angleY})-{ToTestOutputDisplayText(text)}-({x},{y})",
231231
TextDrawingComparer,
232232
appendPixelTypeToFileName: false,
233233
appendSourceFileOrDescription: true);

tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithRotationApplied_Solid1100x1100_(255,255,255,255)_OpenSans-Regular.ttf-50-Sphi-(550,550).png renamed to tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithRotationApplied_Solid1100x1100_(255,255,255,255)_F(OpenSans-Regular.ttf)-S(50)-A(45)-Sphi-(550,550).png

File renamed without changes.

tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithRotationApplied_Solid200x200_(255,255,255,255)_SixLaborsSampleAB.woff-50-ABAB-(100,100).png renamed to tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithRotationApplied_Solid200x200_(255,255,255,255)_F(SixLaborsSampleAB.woff)-S(50)-A(45)-ABAB-(100,100).png

File renamed without changes.

tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithRotationApplied_Solid400x400_(255,255,255,255)_OpenSans-Regular.ttf-20-Sphi-(200,200).png renamed to tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithRotationApplied_Solid400x400_(255,255,255,255)_F(OpenSans-Regular.ttf)-S(20)-A(45)-Sphi-(200,200).png

File renamed without changes.

tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithRotationApplied_Solid50x50_(255,255,255,255)_OpenSans-Regular.ttf-50-i-(25,25).png renamed to tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithRotationApplied_Solid50x50_(255,255,255,255)_F(OpenSans-Regular.ttf)-S(50)-A(45)-i-(25,25).png

File renamed without changes.

tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithSkewApplied_Solid1100x1100_(255,255,255,255)_OpenSans-Regular.ttf-50-Sphi-(550,550).png renamed to tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithSkewApplied_Solid1100x1100_(255,255,255,255)_F(OpenSans-Regular.ttf)-S(50)-A(0,10)-Sphi-(550,550).png

File renamed without changes.

tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithSkewApplied_Solid200x200_(255,255,255,255)_SixLaborsSampleAB.woff-50-ABAB-(100,100).png renamed to tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithSkewApplied_Solid200x200_(255,255,255,255)_F(SixLaborsSampleAB.woff)-S(50)-A(10,0)-ABAB-(100,100).png

File renamed without changes.

tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithSkewApplied_Solid400x400_(255,255,255,255)_OpenSans-Regular.ttf-20-Sphi-(200,200).png renamed to tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithSkewApplied_Solid400x400_(255,255,255,255)_F(OpenSans-Regular.ttf)-S(20)-A(0,-10)-Sphi-(200,200).png

File renamed without changes.

tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithSkewApplied_Solid50x50_(255,255,255,255)_OpenSans-Regular.ttf-50-i-(25,25).png renamed to tests/Images/ReferenceOutput/Drawing/Text/DrawTextOnImageTests/FontShapesAreRenderedCorrectly_WithSkewApplied_Solid50x50_(255,255,255,255)_F(OpenSans-Regular.ttf)-S(50)-A(-12,0)-i-(25,25).png

File renamed without changes.

0 commit comments

Comments
 (0)