[banshee/podcast-ng] [ArtworkRenderer] Missed a condition.



commit b7e20b528244dc8c22a3be197e83b18fecedd81a
Author: Mike Urbanski <michael c urbanski gmail com>
Date:   Tue Mar 30 01:27:14 2010 -0500

    [ArtworkRenderer] Missed a condition.

 .../Banshee.Collection.Gui/ArtworkRenderer.cs      |   32 +++++++++++--------
 1 files changed, 18 insertions(+), 14 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs
index 87faa14..fb48ae9 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs
@@ -39,17 +39,17 @@ namespace Banshee.Collection.Gui
         private static Color cover_border_dark_color = new Color (0.0, 0.0, 0.0, 0.65);
 
         public static void RenderThumbnail (Cairo.Context cr, ImageSurface image, bool dispose,
-            double x, double y, double width, double height, bool drawBorder, double radius, bool sensitive)
+            double x, double y, double width, double height, bool drawBorder, double radius)
         {
             RenderThumbnail (cr, image, dispose, x, y, width, height,
-                drawBorder, radius, false, cover_border_light_color, sensitive);
+                drawBorder, radius, false, cover_border_light_color, true);
         }
 
         public static void RenderThumbnail (Cairo.Context cr, ImageSurface image, bool dispose,
-            double x, double y, double width, double height, bool drawBorder, double radius)
+            double x, double y, double width, double height, bool drawBorder, double radius, bool sensitive)
         {
             RenderThumbnail (cr, image, dispose, x, y, width, height,
-                drawBorder, radius, false, cover_border_light_color);
+                drawBorder, radius, false, cover_border_light_color, sensitive);
         }
 
         public static void RenderThumbnail (Cairo.Context cr, ImageSurface image, bool dispose,
@@ -95,15 +95,7 @@ namespace Banshee.Collection.Gui
 
                 CairoExtensions.RoundedRectangle (cr, p_x, p_y, image.Width, image.Height, radius, corners);
                 cr.SetSource (image, p_x, p_y);
-
-                if (!sensitive) {
-                    cr.Save ();
-                    cr.Clip ();
-                    cr.PaintWithAlpha (0.5);
-                    cr.Restore ();
-                } else {
-                    cr.Fill ();
-                }
+                SensitiveFill (cr, sensitive);
             } else {
                 CairoExtensions.RoundedRectangle (cr, x, y, width, height, radius, corners);
 
@@ -112,7 +104,7 @@ namespace Banshee.Collection.Gui
                     grad.AddColorStop (0, fillColor);
                     grad.AddColorStop (1, CairoExtensions.ColorShade (fillColor, 1.3));
                     cr.Pattern = grad;
-                    cr.Fill ();
+                    SensitiveFill (cr, sensitive);
                     grad.Destroy ();
                 }
 
@@ -147,5 +139,17 @@ namespace Banshee.Collection.Gui
                 ((IDisposable)image).Dispose ();
             }
         }
+
+        private static void SensitiveFill (Context cr, bool sensitive)
+        {
+            if (!sensitive) {
+                cr.Save ();
+                cr.Clip ();
+                cr.PaintWithAlpha (0.5);
+                cr.Restore ();
+            } else {
+                cr.Fill ();
+            }
+        }
     }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]