adg: avoid to screw the cairo context on invalid data
commita90e1320c5d80437414eae25f1c9d05276e69514
authorNicola Fontana <ntd@entidi.it>
Thu, 7 Mar 2013 17:57:05 +0000 (7 18:57 +0100)
committerNicola Fontana <ntd@entidi.it>
Thu, 7 Mar 2013 17:57:05 +0000 (7 18:57 +0100)
tree1a136299c8f0b85afb85f1c49a389cadeac6b815
parent7290a0abf0748da302d2bd4140f7e678cd995b4e
adg: avoid to screw the cairo context on invalid data

Setting a non-invertible cairo matrix on a cairo context will result in
an invalid context: all subsequent cairo API calls will fail. This is by
design, and there is no way to clear the status:

http://lists.cairographics.org/archives/cairo/2008-March/013433.html

Correction of the bug above is in the cairo TODO list.

Added some validation code to avoid most common mistakes, i.e.
coincident points.
src/adg/adg-adim.c
src/adg/adg-ldim.c
src/adg/adg-rdim.c