Re: Real-time ellipse creation - invalid matrix (not invertible) exception
Lockert Fredrick <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <CAPBD81WoGwSoS-FPRa7BHFq3JWnUyFncj=WNmPEjmtTvdYW3Vg@mail.gmail.com> |
On 23 August 2012 22:39, Maximilian Heinzler <[email protected]> wrote: > 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. Thanks mate, that did in fact solve the matrix exception. if(radius_x == 0) radius_x += 0.1; if(radius_y == 0) radius_y += 0.1; Actually, only one of the values had to be 0. So passing either center_x or center_y lines, would cause it to throw an exception. Funny that the documentation doesn't mention that 0 values are invalid (at least I can't remember to have seen any mention of it), would probably save some people some head scratching, me thinks. Again, thank you very much Maximilian. - Fredrick -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo