def __init__(self, start, end, stroke_color=(0,0,0), stroke_width=1, stroke_opacity=1): SvgObject.__init__(self) self.type = "line" self.set_attribute("x1", start[0]) self.set_attribute("y1", start[1]) self.set_attribute("x2", end[0]) self.set_attribute("y2", end[1]) self.set_attribute_color("stroke", stroke_color) self.set_attribute("stroke-width", stroke_width) self.set_attribute("stroke-opacity", stroke_opacity) self.min_corner = util.min_vector([start, end]) self.max_corner = util.max_vector([start, end])
def get_min_corner(self): return util.min_vector([item.get_min_corner() for item in self.items])