[cairo-commit] rcairo/packages/cairo/lib cairo.rb,1.13,1.14

Kouhei Sutou commit at pdx.freedesktop.org
Sun Oct 9 08:37:35 PDT 2005


Committed by: kou

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

Modified Files:
	cairo.rb 
Log Message:
* packages/cairo/ext/rb_cairo_matrix.c: Tidied cairo_matrix_t.
* packages/cairo/lib/cairo.rb: ditto.


Index: cairo.rb
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/lib/cairo.rb,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- cairo.rb	9 Oct 2005 10:25:10 -0000	1.13
+++ cairo.rb	9 Oct 2005 15:37:33 -0000	1.14
@@ -61,26 +61,21 @@
 
   class Matrix
     def dup
-      copy = Matrix.new
-      copy.copy(self)
-      return copy
+      Matrix.new(*to_a)
     end
+    
     def clone
-      copy = Matrix.new
-      copy.copy(self)
+      copy = dup
       copy.freeze if self.frozen?
-      return copy
+      copy
     end
 
-    def transform(tx, ty) ; dup.transform!(tx, ty) ; end
-    def scale(sx, sy) ; dup.scale!(sx, sy) ; end
-    def rotate(radians) ; dup.rotate!(radians) ; end
-    def invert() ; dup.invert! ; end
-
-    def multiply!(other) ; set_product(self, other) ; end
-    def multiply(other) ; Matrix.new.set_product(self, other) ; end
-
-    def *(other) ; Matrix.new.set_product(self, other) ; end
+    def transform(tx, ty); dup.transform!(tx, ty); end
+    def scale(sx, sy); dup.scale!(sx, sy); end
+    def rotate(radians); dup.rotate!(radians); end
+    def invert; dup.invert!; end
+    def multiply(other); dup.multiply!(other); end
+    alias * multiply
   end
 
   class FontOptions



More information about the cairo-commit mailing list