Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Lorentz <bertrand.lorentz@gmail.com>2014-05-30 19:11:55 +0400
committerBertrand Lorentz <bertrand.lorentz@gmail.com>2014-05-30 19:11:55 +0400
commit014d517bfb04121ebafcbc7ad35a199acfc7239f (patch)
tree1cd44b6d1b98ed4f5ffb1713f08014b45cb68455 /mcs/class/Mono.Cairo
parentacc644b7a5e1ee66a1850357c0de29dedf76fe56 (diff)
Mono.Cairo: Add Context.SetSourceColor(Color) convenience method
The Color property was obsoleted, but the suggested replacement SetSourceRGBA has 4 double parameters, which can be unconvenient. Add a SetSourceColor that takes a Cairo.Color parameter, make the Color property use it, and update the message on the Obsolete attribute.
Diffstat (limited to 'mcs/class/Mono.Cairo')
-rw-r--r--mcs/class/Mono.Cairo/Mono.Cairo/Context.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/Context.cs b/mcs/class/Mono.Cairo/Mono.Cairo/Context.cs
index 84059516902..57cb86cd8b0 100644
--- a/mcs/class/Mono.Cairo/Mono.Cairo/Context.cs
+++ b/mcs/class/Mono.Cairo/Mono.Cairo/Context.cs
@@ -161,10 +161,10 @@ namespace Cairo {
}
}
- [Obsolete ("Use SetSourceRGBA method")]
+ [Obsolete ("Use SetSourceColor method")]
public Color Color {
set {
- NativeMethods.cairo_set_source_rgba (handle, value.R, value.G, value.B, value.A);
+ SetSourceColor (value);
}
}
@@ -337,6 +337,11 @@ namespace Cairo {
get { return NativeMethods.cairo_get_reference_count (handle); }
}
+ public void SetSourceColor (Color color)
+ {
+ NativeMethods.cairo_set_source_rgba (handle, color.R, color.G, color.B, color.A);
+ }
+
public void SetSourceRGB (double r, double g, double b)
{
NativeMethods.cairo_set_source_rgb (handle, r, g, b);