mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-16 19:44:45 +02:00
cairo: Fix rectangles returned by StrokeExtents and FillExtents methods
The third and fourth parameters of the Rectangle constructor are width and height, but cairo_stroke_extents and cairo_fill_extents give right and bottom coordinates. Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
This commit is contained in:
parent
629a34aa4f
commit
57c82a89c7
@ -578,7 +578,7 @@ namespace Cairo {
|
|||||||
{
|
{
|
||||||
double x1, y1, x2, y2;
|
double x1, y1, x2, y2;
|
||||||
NativeMethods.cairo_stroke_extents (state, out x1, out y1, out x2, out y2);
|
NativeMethods.cairo_stroke_extents (state, out x1, out y1, out x2, out y2);
|
||||||
return new Rectangle (x1, y1, x2, y2);
|
return new Rectangle (x1, y1, x2 - x1, y2 - y1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Fill ()
|
public void Fill ()
|
||||||
@ -590,7 +590,7 @@ namespace Cairo {
|
|||||||
{
|
{
|
||||||
double x1, y1, x2, y2;
|
double x1, y1, x2, y2;
|
||||||
NativeMethods.cairo_fill_extents (state, out x1, out y1, out x2, out y2);
|
NativeMethods.cairo_fill_extents (state, out x1, out y1, out x2, out y2);
|
||||||
return new Rectangle (x1, y1, x2, y2);
|
return new Rectangle (x1, y1, x2 - x1, y2 - y1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FillPreserve ()
|
public void FillPreserve ()
|
||||||
|
Loading…
Reference in New Issue
Block a user