From: Jeremy O'D. <je...@o-...> - 2003-11-11 22:39:59
|
John Hunter said: > > The GTK and wx backends have the same problem with pixel rounding on > pcolor. I just cured it with GTK and I bet you can do the same for > wx. The trick is to floor the positions and ceil the scales. This > will make it much more likely that the left edge of one rectangle will > align with the right edge of another. Eg, for the GTK backend > [code snipped] I'm sure you're right. I'll try it tomorrow. > Secondly, I am considering making a minor backend change for drawing > 2D solids (arcs, rectangles, polygons) in the Renderer. Rather than > calling the functions twice, once for edge and once for face, I would > like to define them like > > def draw_rectangle(self, gcEdge, x, y, width, height, gcFace=3DNone)= : > > that is, the gcFace takes the place of fill. If None, don't fill, > otherwise fill with the gc in gcFace. > > This will avoid 2 function calls per patch (once on the patch.py end > and once in the backend forwarding it to the underlying renderer, and > will enable backends, eg, postscript, to take advantage of a native > fill commands. For PS, this will at least halve the size of pcolor > output files, which are currently obscenely large. This seems very sensible. The changes required in backend_wx will be minimal, and wx has a native fill (well, a brush...), so I can take advantage of this. Halving the size of PS output is very worthwhile, and it'll probably double the speed of pcolor on wx. Regards Jeremy |