@@ -12,7 +12,7 @@ namespace SixLabors.ImageSharp.Drawing.Tests
1212 internal class DebugDraw
1313 {
1414 private static readonly IBrush TestBrush = Brushes . Solid ( Color . Red ) ;
15-
15+
1616 private static readonly IPen GridPen = Pens . Solid ( Color . Aqua , 0.5f ) ;
1717
1818 private readonly string outputDir ;
@@ -24,18 +24,23 @@ public DebugDraw(string outputDir)
2424
2525 public void Polygon ( IPath path , float gridSize = 10f , float scale = 10f , [ CallerMemberName ] string testMethod = "" )
2626 {
27+ if ( TestEnvironment . RunsOnCI )
28+ {
29+ return ;
30+ }
31+
2732 path = path . Transform ( Matrix3x2 . CreateScale ( scale ) * Matrix3x2 . CreateTranslation ( gridSize , gridSize ) ) ;
2833 RectangleF bounds = path . Bounds ;
2934 gridSize *= scale ;
3035
3136 using Image img = new Image < Rgba32 > ( ( int ) ( bounds . Right + 2 * gridSize ) , ( int ) ( bounds . Bottom + 2 * gridSize ) ) ;
3237 img . Mutate ( ctx => DrawGrid ( ctx . Fill ( TestBrush , path ) , bounds , gridSize ) ) ;
33-
38+
3439 string outDir = TestEnvironment . CreateOutputDirectory ( this . outputDir ) ;
3540 string outFile = System . IO . Path . Combine ( outDir , testMethod + ".png" ) ;
3641 img . SaveAsPng ( outFile ) ;
3742 }
38-
43+
3944 private static PointF P ( float x , float y ) => new PointF ( x , y ) ;
4045
4146 private static void DrawGrid ( IImageProcessingContext ctx , RectangleF rect , float gridSize )
@@ -53,4 +58,4 @@ private static void DrawGrid(IImageProcessingContext ctx, RectangleF rect, float
5358 }
5459 }
5560 }
56- }
61+ }
0 commit comments