(self, aa, view, p)
| 75 | Element.__init__(self, fill=fill, name=name, drawAfter=drawAfter, **kwargs) |
| 76 | |
| 77 | def _drawNameLabel(self, aa, view, p): |
| 78 | x, y = point2D(p) |
| 79 | context = self.context |
| 80 | bs = context.newString(self.name, style=dict(fontSize=18, |
| 81 | textFill=(1, 0, 0))) |
| 82 | tw, th = bs.textSize |
| 83 | M = pt(8) |
| 84 | context.fill(color(1, 1, 1, 0.6)) |
| 85 | context.rect(x + self.w/2 - tw/2 - M, y + self.h/2 - th/2 - M, tw + 2*M, th + 2*M) |
| 86 | context.text(bs, (x + self.w/2 - tw/2, y + self.h/2 - th/4)) |
| 87 | |
| 88 | |
| 89 | if __name__ == '__main__': |