diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-02-04 21:04:32 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-02-04 21:04:32 +0100 |
| commit | 56383b7cadef47e34ba7dce0a676082544bccac7 (patch) | |
| tree | 317c935914ff270949fe0c8a32c2d042a05edf71 /src/Mono.Cairo | |
| parent | 2d93d89034894255917733d9a38bfd7998805f4c (diff) | |
:book: tutorials and some small improvements (iml fragment loading helpers
Diffstat (limited to 'src/Mono.Cairo')
| -rw-r--r-- | src/Mono.Cairo/Context.cs | 10 | ||||
| -rw-r--r-- | src/Mono.Cairo/Rectangle.cs | 132 | ||||
| -rw-r--r-- | src/Mono.Cairo/Surface.cs | 4 |
3 files changed, 73 insertions, 73 deletions
diff --git a/src/Mono.Cairo/Context.cs b/src/Mono.Cairo/Context.cs index 3b731a98..264774dd 100644 --- a/src/Mono.Cairo/Context.cs +++ b/src/Mono.Cairo/Context.cs @@ -450,7 +450,7 @@ namespace Cairo { NativeMethods.cairo_arc_negative (handle, xc, yc, radius, angle1, angle2); } - public void Rectangle (Rectangle rectangle) + public void Rectangle (Crow.Rectangle rectangle) { Rectangle (rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); } @@ -518,11 +518,11 @@ namespace Cairo { NativeMethods.cairo_stroke_preserve (handle); } - public Rectangle StrokeExtents () + public Crow.Rectangle StrokeExtents () { double x1, y1, x2, y2; NativeMethods.cairo_stroke_extents (handle, out x1, out y1, out x2, out y2); - return new Rectangle (x1, y1, x2 - x1, y2 - y1); + return new Crow.Rectangle ((int)x1, (int)y1, (int)(x2 - x1), (int)(y2 - y1)); } public void Fill () @@ -530,11 +530,11 @@ namespace Cairo { NativeMethods.cairo_fill (handle); } - public Rectangle FillExtents () + public Crow.Rectangle FillExtents () { double x1, y1, x2, y2; NativeMethods.cairo_fill_extents (handle, out x1, out y1, out x2, out y2); - return new Rectangle (x1, y1, x2 - x1, y2 - y1); + return new Crow.Rectangle ((int)x1, (int)y1, (int)(x2 - x1), (int)(y2 - y1)); } public void FillPreserve () diff --git a/src/Mono.Cairo/Rectangle.cs b/src/Mono.Cairo/Rectangle.cs index 233a1bac..6766aa45 100644 --- a/src/Mono.Cairo/Rectangle.cs +++ b/src/Mono.Cairo/Rectangle.cs @@ -30,70 +30,70 @@ using System; namespace Cairo { - public struct Rectangle - { - double x; - double y; - double width; - double height; - - public Rectangle (double x, double y, double width, double height) - { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - } - - public Rectangle (Point point, double width, double height) - { - x = point.X; - y = point.Y; - this.width = width; - this.height = height; - } - - public double X { - get { return x; } - } - - public double Y { - get { return y; } - } - - public double Width { - get { return width; } - } - - public double Height { - get { return height; } - } - - public override bool Equals (object obj) - { - if (obj is Rectangle) - return this == (Rectangle)obj; - return false; - } - - public override int GetHashCode () - { - return (int) (x + y + width + height); - } - - public override string ToString () - { - return String.Format ("x:{0} y:{1} w:{2} h:{3}", x, y, width, height); - } - - public static bool operator == (Rectangle rectangle, Rectangle other) - { - return rectangle.X == other.X && rectangle.Y == other.Y && rectangle.Width == other.Width && rectangle.Height == other.Height; - } - - public static bool operator != (Rectangle rectangle, Rectangle other) - { - return !(rectangle == other); - } - } +// public struct Rectangle +// { +// double x; +// double y; +// double width; +// double height; +// +// public Rectangle (double x, double y, double width, double height) +// { +// this.x = x; +// this.y = y; +// this.width = width; +// this.height = height; +// } +// +// public Rectangle (Point point, double width, double height) +// { +// x = point.X; +// y = point.Y; +// this.width = width; +// this.height = height; +// } +// +// public double X { +// get { return x; } +// } +// +// public double Y { +// get { return y; } +// } +// +// public double Width { +// get { return width; } +// } +// +// public double Height { +// get { return height; } +// } +// +// public override bool Equals (object obj) +// { +// if (obj is Rectangle) +// return this == (Rectangle)obj; +// return false; +// } +// +// public override int GetHashCode () +// { +// return (int) (x + y + width + height); +// } +// +// public override string ToString () +// { +// return String.Format ("x:{0} y:{1} w:{2} h:{3}", x, y, width, height); +// } +// +// public static bool operator == (Rectangle rectangle, Rectangle other) +// { +// return rectangle.X == other.X && rectangle.Y == other.Y && rectangle.Width == other.Width && rectangle.Height == other.Height; +// } +// +// public static bool operator != (Rectangle rectangle, Rectangle other) +// { +// return !(rectangle == other); +// } +// } } diff --git a/src/Mono.Cairo/Surface.cs b/src/Mono.Cairo/Surface.cs index d38b7555..6a55496a 100644 --- a/src/Mono.Cairo/Surface.cs +++ b/src/Mono.Cairo/Surface.cs @@ -169,9 +169,9 @@ namespace Cairo { NativeMethods.cairo_surface_mark_dirty (Handle); } - public void MarkDirty (Rectangle rectangle) + public void MarkDirty (Crow.Rectangle rectangle) { - NativeMethods.cairo_surface_mark_dirty_rectangle (Handle, (int)rectangle.X, (int)rectangle.Y, (int)rectangle.Width, (int)rectangle.Height); + NativeMethods.cairo_surface_mark_dirty_rectangle (Handle, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); } public IntPtr Handle { |