wx.lib.graphics bug

Here are two more bugs in wx.lib.graphics.py

class : GraphicsPen
function : Apply
line : 288

ctx.set_dashes( _stdDashes(self._style, self._width) )

I think correct would be:

ctx.set_dash( _stdDashes(self._style, self._width) )

class : GraphicsContext
function : DrawBitmap

The correct way to calculate scale would be like this

scaleX = w / float(bw)
scaleY = h / float(bh)

bw and bh should be of float type or else you'll get an error:

self._context.scale(scaleX, scaleY)
cairo.Error: invalid matrix (not invertible)

Prashant

Python 2.6.2
wxPython 2.8.10.1
XP 32

Thanks.

···

On 2/18/10 7:40 AM, King wrote:

Here are two more bugs in wx.lib.graphics.py

class : GraphicsPen
function : Apply
line : 288

ctx.set_dashes( _stdDashes(self._style, self._width) )

I think correct would be:

ctx.set_dash( _stdDashes(self._style, self._width) )

class : GraphicsContext
function : DrawBitmap

The correct way to calculate scale would be like this

scaleX = w / float(bw)
scaleY = h / float(bh)

bw and bh should be of float type or else you'll get an error:

self._context.scale(scaleX, scaleY)
cairo.Error: invalid matrix (not invertible)

--
Robin Dunn
Software Craftsman