I create a widget that plots data and allows users a selections:
https://gobblin.se/u/kellogs/m/bildschirmfoto-vom-2013-11-12-13-23-54/
Sadly, in this screenshot should appear multiple selections (here red), but rendering n of this models doesn't work for some reason. I made sure, that the data is available and the rendering is called and works fine (right position and dimensions)
So my widget just creates a cairo surface that is used in a iteration of the following method to render the selections on top of the plotted data line:
def render_to(self, cairosurface):
'''external trigger to redraw widget on channel widget surface (only within plotarea!)'''
cr = cairosurface
pos_x=self.__getXPos()
w = self.__getWidth()
h = self.__getHeight()
eogclass=self.eogclassification.eogclass
#background
r,g,b=eogclass.color
alpha=0.9
color=(r,g,b,alpha)
cr.set_source_rgba(*color)
cr.rectangle(pos_x, 0, w, h)
cr.fill()
#label
label=eogclass.name
cr.set_source_rgb(*eogclass.text_color)
cr.set_font_size(13)
(x, y, width, height, dx, dy) = cr.text_extents(label)
cr.move_to(pos_x+w/2 - width/2, h/2) #center within our block
cr.text_path(label)
cr.clip()
cr.stroke()
cr.paint()
Can anybody give me a tip what might be the problem? I'm not sure, but can this be a problem with compositing?