Hi everyone!
I have an application where the user can draw lines, bitmaps and text
on a FloatCanvas, and then export it to a file.
It used to work nicely on Ubuntu 9.04 (wxPython 2.8.9.1), but now on
Ubuntu 10.04 (wxPython 2.8.10.1) it's behaving erratically. Basically,
the export process seems to be "cutting" the ScaledText objects over a
certain y-coordinate, so for example if I write something above this
limit, the text shows up on the exported file, while if it's below it
doesn't show, or gets cut at midway if it's across the limit. Other
objects instead show up just fine, wherever they are.
What's really weird though is that I'm testing this on my laptop, a VM
and 3 other workstations, and the strange behaviour is present only on
two machines, even though every environment is running the same
distribution. What could I check?
Here's how I export the canvas to file:
canvas.Scale = 1
canvas.SetToNewScale(False)
canvas._ResetBoundingBox()
# Align the viewport
box = canvas.BoundingBox
canvas.ViewPortCenter -= (canvas.PixelToWorld((0,0)) -
numpy.array((box[0,0], box[1,1])))
# Let's draw
bmp = wx.EmptyBitmap(box.Width, box.Height)
dc = wx.MemoryDC()
dc.SelectObject(bmp)
dc.Clear()
canvas._DrawObjects(dc, canvas._DrawList, dc, canvas.BoundingBox)
dc.SelectObject(wx.NullBitmap)
Many thanks!