def __init__(self, obj, **options): Rectangle.__init__(self, **options) Group.__init__(self, **options) bbox = obj.bbox() self.object = obj w = bbox.width + 2 * self.pad h = bbox.height + 2 * self.pad # overide the width and height if supplied if self.width is None: self.width = options.get('width', w) if self.height is None: self.height = options.get('height', h) self.append( Rectangle(width=self.width, height=self.height, bg=self.bg, fg=self.fg, c=obj.c, r=self.r, linewidth=self.linewidth, dash=self.dash), obj, )
def __init__(self, obj, **options): Rectangle.__init__(self, **options) Group.__init__(self, **options) bbox = obj.bbox() w = bbox.width + 2 * self.pad h = bbox.height + 2 * self.pad self.width = options.get('width', w) self.height = options.get('height', h) self.append( Rectangle(width=self.width, height=self.height, bg=self.bg, fg=self.fg, c=obj.c, r=self.r, linewidth=self.linewidth, dash=self.dash), obj, )