[Gtk-sharp-list] [gtk-sharp] Matrix.Scale and Context.Scale anomaly?

Hywel hywel.w.thomas at gmail.com
Thu Apr 11 19:03:54 UTC 2013


Answering my own question, I have just realised that although scaling 
with a zero value for sx or sy is valid mathematically, the resulting 
matrix is non-invertible, and so gets picked up by Context.Scale, giving 
an error immediately (rather than perhaps later down the line, in a more 
obscure situation).  Perhaps this might help others who wonder what is 
going on!

On 11/04/13 13:14, Hywel wrote:
> Using a Cairo.Matrix.Scale (sx, sy) with a zero value for either sx or 
> sy gives the correct result (the Xx or the Yy component of the matrix 
> is zero'd), but using Context.Scale with either zero value for sx or 
> sy gives the wrong result for the Context Transformation Matrix.  
> There seems to be no valid reason why these should differ 
> (mathematically they are valid, though perhaps unlikely, operations).  
> I'm not sure how the two functions call back into the Cairo 'C' code - 
> can anyone help or shed any light on this apparent anomaly?



More information about the Gtk-sharp-list mailing list