Re: goocanvasmm: problem on accessing cairo matrix
- From: David Davies <David questans co uk>
- To: gtkmm-list gnome org
- Subject: Re: goocanvasmm: problem on accessing cairo matrix
- Date: Tue, 14 Jul 2009 14:41:03 +0100
Many thanks Murray.
As you suspected pMatrix is null until translate() is invoked, when it
is becomes initialized.
Presumably, the other transform methods would initialize it similarly
though I haven't tested this yet.
I find this strange but no longer a problem.
Murray Cumming wrote:
On Mon, 2009-07-13 at 18:28 +0100, David Davies wrote:
cairo_matrix_t * pMatrix = m_text->property_transform(); // line A
double x0 = pMatrix->x0; // line B
My aim is to output the components of the transform matrix so that I
understand what is happening to it.
The program compiles and links in CDT with no reported error.
If I comment out line B, it runs OK and, as expected, gives the same
output as the original example.
With line B however, the program terminates and outputs a
message without opening a window.
It does not report an error.
You really need to use a debugger. I suspect that pMatrix is null. You
should check pointers for null before dereferencing them anyway.
I don't know _why_ it is null. Maybe that's a normal value, if there is
no "transformation matrix" set for the item, though I don't quite know
when that would be set.
] [Thread Prev