def __init__ (self, **attr): GroupableElement.__init__ (self, name = 'svg', **attr) BoxElement.__init__ (self, name = 'svg', **attr) if attr.has_key ('viewBox'): self.viewBox = attr['viewBox'] else: self.viewBox = None
def __init__(self, **attr): GroupableElement.__init__(self, name='svg', **attr) BoxElement.__init__(self, name='svg', **attr) if attr.has_key('viewBox'): self.viewBox = attr['viewBox'] else: self.viewBox = None
def __init__ (self, **attr): BoxElement.__init__ (self, name = 'rect', **attr) if attr.has_key ('width'): self.width = float (attr['width']) else: self.width = None if attr.has_key ('height'): self.height = float (attr['height']) else: self.height = None
def __init__(self, **attr): BoxElement.__init__(self, name='rect', **attr) if attr.has_key('width'): self.width = float(attr['width']) else: self.width = None if attr.has_key('height'): self.height = float(attr['height']) else: self.height = None if attr.has_key('absoluteSize'): self.absoluteSize = bool(attr['absoluteSize']) else: self.absoluteSize = False if attr.has_key('worldDeltaX'): self.worldDeltaX = float(attr['worldDeltaX']) else: self.worldDeltaX = 0.0 if attr.has_key('worldDeltaY'): self.worldDeltaY = float(attr['worldDeltaY']) else: self.worldDeltaY = 0.0
def setSVG (self): attr = BoxElement.setSVG (self) if not self.absoluteSize: points = self.calulateBox (self.x, self.y, self.width, self.height) else: point = V (self.x, self.y) self.applyTransform (point) points = {'x': point.x, 'y': point.y, 'width': self.width, 'height': self.height} points['x'] += self.worldDeltaX points['y'] += self.worldDeltaY attr.update (points) return attr
def __init__ (self, **attr): BoxElement.__init__ (self, name = 'rect', **attr) if attr.has_key ('width'): self.width = float (attr['width']) else: self.width = None if attr.has_key ('height'): self.height = float (attr['height']) else: self.height = None if attr.has_key ('absoluteSize'): self.absoluteSize = bool (attr['absoluteSize']) else: self.absoluteSize = False if attr.has_key ('worldDeltaX'): self.worldDeltaX = float (attr['worldDeltaX']) else: self.worldDeltaX = 0.0 if attr.has_key ('worldDeltaY'): self.worldDeltaY = float (attr['worldDeltaY']) else: self.worldDeltaY = 0.0
def setSVG(self): attr = BoxElement.setSVG(self) if not self.absoluteSize: points = self.calulateBox(self.x, self.y, self.width, self.height) else: point = V(self.x, self.y) self.applyTransform(point) points = { 'x': point.x, 'y': point.y, 'width': self.width, 'height': self.height } points['x'] += self.worldDeltaX points['y'] += self.worldDeltaY attr.update(points) return attr
def setSVG (self): attr = BoxElement.setSVG (self) attr.update (GroupableElement.setSVG (self)) attr.update ([('viewBox', self.viewBox)]) return attr
def setSVG(self): attr = BoxElement.setSVG(self) attr.update([('xlink:href', self.href)]) return attr
def __init__(self, **attr): BoxElement.__init__(self, name='use', **attr) if attr.has_key('href'): self.href = attr['href'] else: self.href = None
def setSVG (self): attr = BoxElement.setSVG (self) points = self.calulateBox (self.x, self.y, self.width, self.height) attr.update (points) return attr
def setSVG (self): attr = BoxElement.setSVG (self) attr.update ([('xlink:href', self.href)]) return attr
def __init__ (self, **attr): BoxElement.__init__ (self, name = 'use', **attr) if attr.has_key ('href'): self.href = attr['href'] else: self.href = None
def setSVG(self): attr = BoxElement.setSVG(self) attr.update(GroupableElement.setSVG(self)) attr.update([('viewBox', self.viewBox)]) return attr