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

github.com/mono/xwt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLluis Sanchez Gual <lluis@xamarin.com>2013-12-10 14:43:45 +0400
committerLluis Sanchez Gual <lluis@xamarin.com>2013-12-10 14:43:45 +0400
commitc7b80f72086331c73d78e74abe258e42f02a0e96 (patch)
tree51ec4f30c87aa946d5b50df41e12b85362f69053 /Xwt.Gtk
parentf14843177b0ce942a61d2d08d15e368b4e0acb1d (diff)
Fix build when using old Cairo
Diffstat (limited to 'Xwt.Gtk')
-rw-r--r--Xwt.Gtk/Xwt.GtkBackend/ImageHandler.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Xwt.Gtk/Xwt.GtkBackend/ImageHandler.cs b/Xwt.Gtk/Xwt.GtkBackend/ImageHandler.cs
index 26c4e869..f60e8f04 100644
--- a/Xwt.Gtk/Xwt.GtkBackend/ImageHandler.cs
+++ b/Xwt.Gtk/Xwt.GtkBackend/ImageHandler.cs
@@ -400,8 +400,13 @@ namespace Xwt.GtkBackend
ctx.Scale (idesc.Size.Width / (double)img.Width, idesc.Size.Height / (double)img.Height);
Gdk.CairoHelper.SetSourcePixbuf (ctx, img, 0, 0);
- // Fixes blur issue when rendering on an image surface
- ((Cairo.SurfacePattern)ctx.GetSource ()).Filter = Cairo.Filter.Fast;
+ #pragma warning disable 618
+ if (idesc.Size.Width > img.Width || idesc.Size.Height > img.Height) {
+ // Fixes blur issue when rendering on an image surface
+ ((Cairo.SurfacePattern)ctx.Source).Filter = Cairo.Filter.Fast;
+ } else
+ ((Cairo.SurfacePattern)ctx.Source).Filter = Cairo.Filter.Good;
+ #pragma warning restore 618
if (idesc.Alpha >= 1)
ctx.Paint ();