[hyena] RatingRenderer: Restore the state of the Cairo Context after rendering



commit 5acb71dac3f3921eebb716804091f62c73271b83
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Sat Mar 31 20:02:36 2012 +0200

    RatingRenderer: Restore the state of the Cairo Context after rendering
    
    This allows callers to use the Context after passing it to the Render
    method, without having to save its state themselves.

 Hyena.Gui/Hyena.Gui/RatingRenderer.cs |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Gui/RatingRenderer.cs b/Hyena.Gui/Hyena.Gui/RatingRenderer.cs
index 50974ba..9600cc8 100644
--- a/Hyena.Gui/Hyena.Gui/RatingRenderer.cs
+++ b/Hyena.Gui/Hyena.Gui/RatingRenderer.cs
@@ -59,6 +59,8 @@ namespace Hyena.Gui
                 return;
             }
 
+            cr.Save ();
+
             Cairo.Color fill_color = color;
             fill_color.A = fillOpacity;
             Cairo.Color stroke_color = fill_color;
@@ -101,6 +103,7 @@ namespace Hyena.Gui
                     cr.Stroke ();
                 }
             }
+            cr.Restore ();
         }
 
         protected void ComputePosition (Gdk.Rectangle area, out double x, out double y)



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