diff options
author | Lluis Sanchez Gual <lluis@xamarin.com> | 2013-12-10 14:43:45 +0400 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2013-12-10 14:43:45 +0400 |
commit | c7b80f72086331c73d78e74abe258e42f02a0e96 (patch) | |
tree | 51ec4f30c87aa946d5b50df41e12b85362f69053 /Xwt.Gtk | |
parent | f14843177b0ce942a61d2d08d15e368b4e0acb1d (diff) |
Fix build when using old Cairo
Diffstat (limited to 'Xwt.Gtk')
-rw-r--r-- | Xwt.Gtk/Xwt.GtkBackend/ImageHandler.cs | 9 |
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 (); |