enthought/enable — pull request #68 by WarrenWeckesser (2012-08-29 18:39:42+00:00)
Title: Agg's GraphicsContext.set_text_matrix() function should accept a 3x3 numpy array

This pull request allows the set_text_matrix() method of the GraphicsContext class in the Agg backend to accept 3x3 numpy arrays. This is consistent with the other backends.

Before:

```
In [1]: from kiva.affine import affine_from_rotation

In [2]: from kiva.agg import GraphicsContextArray

In [3]: r = affine_from_rotation(pi/3)

In [4]: r
Out[4]:
array([[ 0.5 , 0.8660254, 0. ],
[-0.8660254, 0.5 , 0. ],
[ 0. , 0. , 1. ]])

In [5]: gc = GraphicsContextArray((10,10))

In [6]: gc.set_text_matrix(r)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/Users/warren/ in ()
----> 1 gc.set_text_matrix(r)

/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/kiva/agg/agg.pyc in set_text_matrix(self, *args)
916
917 def is_font_initialized(self, *args): return _agg.GraphicsContextArray_is_font_initialized(self, *args)
--> 918 def set_text_matrix(self, *args): return _agg.GraphicsContextArray_set_text_matrix(self, *args)
919 def get_text_matrix(self, *args): return _agg.GraphicsContextArray_get_text_matrix(self, *args)
920 def set_character_spacing(self, *args): return _agg.GraphicsContextArray_set_character_spacing(self, *args)

TypeError: in method 'GraphicsContextArray_set_text_matrix', argument 2 of type 'agg24::trans_affine &'
```

After:

```
In [1]: from kiva.affine import affine_from_rotation

In [2]: from kiva.agg import GraphicsContextArray

In [3]: r = affine_from_rotation(pi/3)

In [4]: gc = GraphicsContextArray((10,10))

In [5]: gc.set_text_matrix(r)

In [6]: gc.get_text_matrix()
Out[6]: AffineMatrix(0.5,0.866025,-0.866025,0.5,0,0)
```