enthought/enable — pull request #58 by RobinD42 (2012-06-27 01:13:07+00:00)
Title: Fix dashed lines in 64-bit OSX.

The CGFloat type is a float in 32-bit and a double in 64-bit CoreGraphics code. Most of the time always treating it as one or the other in kiva/quartz cython code would probably be ok since the C compiler will usually take care of the difference. However when pointers or arrays are used it is not safe to always use float since the APIs will expect more room to write to. For CGContextSetLineDash this problem manifests as no dashes being used and repeated log messages such as the following:

Jun 26 15:44:46 havok.alldunn2.com Python[57422] : CGContextSetLineDash: invalid dash array: negative lengths are not allowed.

This patch adds the minimum needed to get dashed lines working in 64-bit builds. Adds a ctypedef for CGFloat and uses it in the prototype of CGContextSetLineDash and in set_line_dash. This causes Cython to use the CGFloat type in the generated code and all is well.

To avoid other problems the rest of the floats that are really CGFloat types in the API should be changed as well...