[cairo-commit] rcairo/packages/cairo/lib cairo.rb,1.1,1.2

Oeyvind Kolaas commit at pdx.freedesktop.org
Wed Feb 9 03:58:29 PST 2005


Committed by: pippin

Update of /cvs/cairo/rcairo/packages/cairo/lib
In directory gabe:/tmp/cvs-serv16454/packages/cairo/lib

Modified Files:
	cairo.rb 
Log Message:
Made save method take optional block.

Index: cairo.rb
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/lib/cairo.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cairo.rb	8 Feb 2005 01:47:51 -0000	1.1
+++ cairo.rb	9 Feb 2005 11:58:27 -0000	1.2
@@ -61,6 +61,20 @@
         self.set_rgb_color(*args)
     end
 
+    alias save_internal save
+    def save
+        if block_given?
+            save_internal
+            begin
+                yield
+            ensure
+                restore
+            end
+        else
+            save_internal
+        end
+    end
+
     alias operator= set_operator
     alias operator current_operator
     alias alpha= set_alpha




More information about the cairo-commit mailing list