[ease] Declare Cairo radient only once



commit d633ac43b005f1c723245ed890036568c3d4661c
Author: Stéphane Maniaci <stephane maniaci gmail com>
Date:   Mon Aug 16 13:40:25 2010 -0500

    Declare Cairo radient only once

 ease/ease-player.vala |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/ease/ease-player.vala b/ease/ease-player.vala
index 5388a1a..620c7ef 100644
--- a/ease/ease-player.vala
+++ b/ease/ease-player.vala
@@ -112,6 +112,11 @@ internal class Ease.Player : Gtk.Window
 		focus_circle.opacity = 0;
 		focus_circle.set_position (stage.width/2, stage.height/2);
 
+		radial = new Cairo.Pattern.radial (0, 0, FOCUS_RADIUS,
+										   0, 0, 2*FOCUS_RADIUS);
+		radial.add_color_stop_rgb (0, 1, 1, 1);
+		radial.add_color_stop_rgb (1, 0, 0, 0);
+
 		this.stage.add_actor (focus_circle);
 		stage.set_clip(0, 0, doc.width, doc.height);
 
@@ -149,10 +154,6 @@ internal class Ease.Player : Gtk.Window
 			var cr = focus_circle.create ();
 			
 			cr.translate (event.x, event.y);
-			radial = new Cairo.Pattern.radial (0, 0, FOCUS_RADIUS, 
-											   0, 0, 2*FOCUS_RADIUS);
-			radial.add_color_stop_rgb (0, 1, 1, 1);
-			radial.add_color_stop_rgb (1, 0, 0, 0);
 
 			cr.set_source (radial);
 			cr.paint ();
@@ -180,10 +181,6 @@ internal class Ease.Player : Gtk.Window
 		var cr = focus_circle.create ();
 
 		cr.translate (event.x, event.y);
-		radial = new Cairo.Pattern.radial (0, 0, FOCUS_RADIUS,
-										   0, 0, 2*FOCUS_RADIUS);
-		radial.add_color_stop_rgb (0, 1, 1, 1);
-		radial.add_color_stop_rgb (1, 0, 0, 0);
 
 		cr.set_source (radial);
 		cr.paint ();



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