def scale(self, amount): """1 = 100%""" group = g() for e in self: group.addElement(e) tb = TransformBuilder() tb.setScaling(amount, amount) group.set_transform(tb.getTransform()) self.items = [group] return self
def scale(elems, amount): """1 = 100%""" group = g() for e in elems: group.addElement(e) tb = TransformBuilder() #tb.setRotation(rotate(x1, y1, x2, y2)) tb.setScaling(amount, amount) group.set_transform(tb.getTransform()) return group
def chair(self, id_attr, color_1, color_2): head = ShapeBuilder().createCircle(30, 25, 20, stroke='black', strokewidth=5.0, fill=color_1) head.set_class('head') body = path(pathData="M 19.264266,38.267870 C 12.892238,41.659428 9.0221978,48.396703 6.6126745,55.405840 L 51.476471,55.405840 C 49.270169,48.545436 45.682644,41.911786 39.811885,38.267870 C 33.901416,38.010889 26.459633,38.267870 19.264266,38.267870 z ") body.set_style('stroke-width:5.0;stroke:black;fill:%s;' % color_2) body.set_class('body') th = TransformBuilder() th.setScaling('0.8', '0.8') group = g() group.addElement(body) group.addElement(head) group.set_id(id_attr) group.set_transform(th.getTransform()) return group