[banshee/gtk3] LargeTrackInfoDisaply: replace an IDisposable cast/call with using{} syntax
- From: Andrés Aragoneses <aaragoneses src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee/gtk3] LargeTrackInfoDisaply: replace an IDisposable cast/call with using{} syntax
- Date: Sat, 24 Aug 2013 12:28:03 +0000 (UTC)
commit ab674798f5b14f7faac76c3489dac45549aa479a
Author: Andrés G. Aragoneses <knocte gmail com>
Date: Sat Aug 24 14:11:37 2013 +0200
LargeTrackInfoDisaply: replace an IDisposable cast/call with using{} syntax
.../Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs | 46 ++++++++++----------
1 files changed, 23 insertions(+), 23 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs
b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs
index 872f537..7209f3c 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs
@@ -143,39 +143,39 @@ namespace Banshee.Gui.Widgets
{
Surface surface = window_cr.Target.CreateSimilar (window_cr.Target.Content,
image.Width, image.Height + reflect);
- Cairo.Context cr = new Context (surface);
+ using (var cr = new Context (surface)) {
- cr.Save ();
+ cr.Save ();
- cr.SetSource (image);
- cr.Paint ();
+ cr.SetSource (image);
+ cr.Paint ();
- cr.Rectangle (0, image.Height, image.Width, reflect);
- cr.Clip ();
+ cr.Rectangle (0, image.Height, image.Width, reflect);
+ cr.Clip ();
- Matrix matrix = new Matrix ();
- matrix.InitScale (1, -1);
- matrix.Translate (0, -(2 * image.Height) + 1);
- cr.Transform (matrix);
+ Matrix matrix = new Matrix ();
+ matrix.InitScale (1, -1);
+ matrix.Translate (0, -(2 * image.Height) + 1);
+ cr.Transform (matrix);
- cr.SetSource (image);
- cr.Paint ();
+ cr.SetSource (image);
+ cr.Paint ();
- cr.Restore ();
+ cr.Restore ();
- Color bg_transparent = BackgroundColor;
- bg_transparent.A = 0.65;
+ Color bg_transparent = BackgroundColor;
+ bg_transparent.A = 0.65;
- LinearGradient mask = new LinearGradient (0, image.Height, 0, image.Height + reflect);
- mask.AddColorStop (0, bg_transparent);
- mask.AddColorStop (1, BackgroundColor);
+ LinearGradient mask = new LinearGradient (0, image.Height, 0, image.Height + reflect);
+ mask.AddColorStop (0, bg_transparent);
+ mask.AddColorStop (1, BackgroundColor);
- cr.Rectangle (0, image.Height, image.Width, reflect);
- cr.Pattern = mask;
- cr.Fill ();
- mask.Destroy ();
+ cr.Rectangle (0, image.Height, image.Width, reflect);
+ cr.SetSource (mask);
+ cr.Fill ();
+ mask.Destroy ();
- ((IDisposable)cr).Dispose ();
+ }
return surface;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]