[macruby-changes] [521] MacRuby/trunk/sample-macruby/PathDemo/DemoView.rb

source_changes at macosforge.org source_changes at macosforge.org
Fri Aug 29 19:46:44 PDT 2008


Revision: 521
          http://trac.macosforge.org/projects/ruby/changeset/521
Author:   lsansonetti at apple.com
Date:     2008-08-29 19:46:43 -0700 (Fri, 29 Aug 2008)
Log Message:
-----------
removed unnecessary code

Modified Paths:
--------------
    MacRuby/trunk/sample-macruby/PathDemo/DemoView.rb

Modified: MacRuby/trunk/sample-macruby/PathDemo/DemoView.rb
===================================================================
--- MacRuby/trunk/sample-macruby/PathDemo/DemoView.rb	2008-08-29 20:30:29 UTC (rev 520)
+++ MacRuby/trunk/sample-macruby/PathDemo/DemoView.rb	2008-08-30 02:46:43 UTC (rev 521)
@@ -1,9 +1,3 @@
-class NSRect
-  def to_cgrect
-    CGRect.new(CGPoint.new(origin.x, origin.y), CGSize.new(size.width, size.height))
-  end
-end
-
 class DemoView < NSView
 
   attr_accessor :demoNumber
@@ -16,17 +10,16 @@
   end
 
   def drawRect(rect)
-    r = rect.to_cgrect
 	context = NSGraphicsContext.currentContext.graphicsPort
 	
     CGContextSetGrayFillColor(context, 1.0, 1.0)
-    CGContextFillRect(context, r)
+    CGContextFillRect(context, rect)
 
     case @demoNumber
-    when 0 then rectangles(context, r)
-    when 1 then circles(context, r)
-    when 2 then bezierPaths(context, r)
-    when 3 then circleClipping(context, r)
+    when 0 then rectangles(context, rect)
+    when 1 then circles(context, rect)
+    when 2 then bezierPaths(context, rect)
+    when 3 then circleClipping(context, rect)
     else
       NSLog("Invalid demo number #{@demoNumber}")
     end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080829/24d5bce8/attachment.html 


More information about the macruby-changes mailing list