[MacRuby-devel] is hotcocoa dead ?

Vincenzo Piombo vipenzo at gmail.com
Wed Mar 23 14:52:42 PDT 2011


Hello all,
  I discovered macruby since a few weeks and I'm really enthusiast.
I begun playing with it and really like the hotcocoa approach, but it seems
stopped since more than a year, is it still maintained ?

Anyway, I think I found a bug in the hotcocoa canvas part: the text method
draws at a very big size regardless of the chosen font. The problem is that
the transformation matrix for the text is not set.

Here is the fix if anyone needs it:

module HotCocoa::Graphics
  class Canvas
    def text(txt="A", x=0, y=0)
      affine = CGContextGetCTM(@ctx)
      CGContextSetTextMatrix (@ctx, affine);
      txt = txt.to_s unless txt.kind_of?(String)
      if @registration == :center
        width = textwidth(txt)
        x = x - width / 2
        y = y + @fsize / 2
      end
      CGContextShowTextAtPoint(@ctx, x, y, txt, txt.length)
    end
  end
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20110323/3c5d2219/attachment.html>


More information about the MacRuby-devel mailing list