def draw(self): super(MyScribbleWidget,self).draw() # set_color(1, 1, 1) d_txt = self.potential_deleted_text if d_txt: x = int(time.time()) % 2 if x == 0: b_col = d_txt.style['bg-color'] d_txt.style['bg-color'] = d_txt.style['border-color'] d_txt.style['border-color'] = b_col _del_list = [] for k in self.touch_positions.keys(): _points = self.touch_positions[k]['Cdata'] if not len(_points): _del_list.append(k) continue _colour = self.touch_positions[k]['Color'] if self.potential_deleted_lines == k: x = int(time.time()) % 2 if x == 0: _colour = DELETED_LINE else: self.touch_positions[k]['Color'] = RED set_color(*_colour) drawLine(_points) for k in _del_list: del self.touch_positions[k]
def draw(self): '''Draw the path on screen (filled or line)''' if not self._dl.is_compiled(): with self._dl: if self.filled: self.draw_filled_path() else: drawLine(self.path) self._dl.draw()
def draw(self): # draw background set_color(*self.bgcolor) drawRectangle(pos=self.pos, size=self.size) # draw current trace set_color(1,1,1) for trace in self.points: l = [] for p in self.points[trace]: l.append(p[0]) l.append(p[1]) drawLine(l) labeltext = '' if self.lastbest: labeltext = 'Creating : %s' % self.lastbest[1].label s = self.width *.1 drawLabel(label=labeltext, pos=(self.pos[0] + s*3, self.pos[1] + \ self.height + s * 0.8 + self.height * 0.07), font_size=self.height * 0.07, center=False)