PintaProject/Pinta — pull request #50 by don-mccomb (2012-12-10 12:50:58+00:00)
Title: Added FixedStrokeExtents() to correct Rectangle returned by StrokeExtents

The Cairo.Context.StrokeExtents() method returns a rectangle in which the X & Y coordinates of the bottom-right corner are incorrectly specified in the width and height members. In the previous code only CairoExtensions.GetBounds(Path) was correcting for this. As a result of this Cairo bug, when you drew a very small line in the middle of the image with the PaintBrush tool, Pinta would invalidate the entire bottom-right corner of the image. In most cases this would not be a big deal, but I thought it worth fixing none-the-less.
If some time in the future the bug is fixed in Cairo, would there be consequences for a version of Pinta with this fix? Should we perform a test during program startup to check if the fix is required?
After fixing the issue, it was found that when drawing with a small brush width, the corners of the invalidation rectangle were being clipped to short, so I added an Inflate(1, 1) to PlainBrush. This is a bit of a hack and I'd prefer not to have it, but oh well...