[mcclim-devel] Flipping sheet coords

Duncan Rose duncan at robotcat.demon.co.uk
Fri Mar 25 22:49:59 UTC 2005


This is probably rather Cocoa-centric, so I'll probably be boring 
anybody that
doesn't know any of Apple's frameworks with the following...

I've been looking at the Beagle back end again recently looking to 
complete the
remaining functionality and speed it up somewhat. One of the things I 
want to
do to hopefully speed things up is move to a delayed drawing 
implementation
(which is the way Apple recommend doing things anyway; all drawing is 
done in
a 'drawRect' method which is invoked as part of the main event loop by 
the
underlying windowing system).
In order to make this work I've migrated the text drawing to append 
glyphs
to an NSBezierPath subclass; in order to implement the delayed drawing 
I just
stack all bezier path objects up in an array and stroke or fill them at 
the
appropriate time.

The problem I have is that Cocoa and McCLIM have different coordinate 
systems
(the y-axes are reversed) by 'default'. Previously I dealt with this by 
setting
the view up to be 'flipped' which is standard Cocoa functionality. This 
works
in general but text is rendered upside down. What I'd *like* to do is 
to be
able to set a transform which would automatically take care of this 
within
McCLIM (rather than within Cocoa). What I'm hoping is that there's an 
easy
solution to this (such as applying an inverting transform the the graft 
and
having this by default apply to anything grafted onto it).

So my question boils down to "does using a :graphics oriented graft 
rather than
a :default orientation make any difference at all to anything attached 
to that
graft"? An additional question might be "if not, should it?" (I'd like 
to
have a CLIM solution to this but if there appears not to be one I'll 
hack
something into the back end to do it via Cocoa - it seems to me that if 
I
apply the appropriate transform to the graft things should 'just work' 
but
maybe I'm misunderstanding how things fit together).

Also, who do I need to see to get CVS commit privs again or should I 
just be
submitting patches?

Thanks,

-Duncan




More information about the mcclim-devel mailing list