Ivan's Space

Writing about leadership, management, emotional resiliency, software engineering, tech, gadgets.




read

After making my first Mono bug report ever, I made a patch to fix the bug :). The problem was the incorrect handling of the number of points when drawing a curve with specified number of line segment. Here it is:

Index: mcs/class/System.Drawing/System.Drawing/Graphics.cs

— mcs/class/System.Drawing/System.Drawing/Graphics.cs (revision 53896)
+++ mcs/class/System.Drawing/System.Drawing/Graphics.cs (working copy)
@@ -387,8 +387,10 @@
throw new ArgumentNullException (“points”);

Status status;

  • int numberOfPoints = numberOfSegments + 1;
  • status = GDIPlus.GdipDrawCurve3 (nativeObject, pen.nativeObject,
    – points, points.Length, offset,
  • points, numberOfPoints, offset,
    numberOfSegments, 0.5f);
    GDIPlus.CheckStatus (status);
    }
    @@ -401,8 +403,10 @@
    throw new ArgumentNullException (“points”);

Status status;

  • int numberOfPoints = numberOfSegments + 1;
  • status = GDIPlus.GdipDrawCurve3I (nativeObject, pen.nativeObject,
    – points, points.Length, offset,
  • points, numberOfPoints, offset,
    numberOfSegments, tension);
    GDIPlus.CheckStatus (status);
    }
    @@ -416,8 +420,10 @@
    throw new ArgumentNullException (“points”);

Status status;

  • int numberOfPoints = numberOfSegments + 1;
  • status = GDIPlus.GdipDrawCurve3 (nativeObject, pen.nativeObject,
    – points, points.Length, offset,
  • points, numberOfPoints, offset,
    numberOfSegments, tension);
    GDIPlus.CheckStatus (status);
    }
Blog Logo

Ivan Zlatev


Published

Image

Ivan's Space

Writing about leadership, management, emotional resiliency, software engineering, tech, gadgets.

Back to Overview