On 20 Sep 2008, at 21:01, Fabien Costantini wrote: >> The key to this turns out to be *when* I modify fltk's clip region. >> If I modify the clip region *before* I obtain a Cairo context for the >> window, all is well. >> But if I obtain the Cairo context, *then* modify the clip region, all >> the Cairo drawing is inverted and offset. > > This probably has to do with the Fl_mac.cxx q_fill_context() API. > > One of the big differences between Quartz and QD is that Quartz > coordinates space has the Y orientation inverted compared to QD. > This is why in fltk, the q_fill_context() transforms the Quartz > origin to be at the upper-left like QD so it turns upside down the > Y coordinates...
Yup - I'd seen (from Matt's comments on the code) that the origin was flipped, and hence there was a transform scaling being applied to the Quartz context to "fix" that in fltk. Of course fltk and Cairo have the same orientation, so presumably the Cairo "Quartz" context is doing some form of scaling itself, also. What really surprised me about this, and the main thing I wanted to flag up, was the effect that modifying the fltk clip region was having on my Cairo context - in that *if* I obtain the Cairo context after I have stopped "adjusting" the fltk context, then all is well, but if I "adjust" the fltk context at all, after obtaining the Cairo context, then the Cairo context will be messed up... That effect seemed odd to me, and therefore worthy of comment. Cheers, and thanks for your inputs, -- Ian _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

