Re: Real-time ellipse creation - invalid matrix (not invertible) exception
"Maximilian Heinzler" <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <[email protected]> |
I think the problem appears if the mouse is the same position as the initial click. This would cause a cr->scale(0, 0), which results in an invalid matrix. So just do a little check before this drawing operation or set a minimum size for the ellipse. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Lockert Fredrick Sent: Thursday, August 23, 2012 3:28 PM To: Carlos López González Cc: [email protected] Subject: Re: [cairo] Real-time ellipse creation - invalid matrix (not invertible) exception On 23 August 2012 17:56, Carlos López González <[email protected]> wrote: > I think that you have to restore after stroke, not before: > > > cr->set_source_rgb(1.0, 1.0, 1.0); > cr->fill_preserve(); > cr->stroke(); > cr->restore(); /// restore after stroke operation, not before That would cause the stroke to be scaled with the arc, which would create an undesired thick line around it. The problem lies in the arc's scale operation. Whenever it goes from positive to negative, it sometimes result in an invalid matrix. If the mouse is moved fast enough though, it doesn't create an exception... this confuses me more or less. Thanks for your suggestion though, I really do appreciate it. - Fredrick -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo