Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Added FixedStrokeExtents() to correct Rectangle returned by StrokeExtents #50
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.
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
This looks like a bug with the Cairo wrapper (line 581 of https://github.com/mono/gtk-sharp/blob/master/cairo/Context.cs), not with Cairo itself, so we should probably send a pull request with a fix to https://github.com/mono/gtk-sharp
I suppose we could just make FixedStrokeExtents directly call the cairo_stroke_extents native method, since that would avoid any issues with detecting whether Context.StrokeExtents is working correctly in future versions of the cairo wrapper.