Example #1
0
 def rect(self, x, y, w, h):
     self.pathStr.append(PathElement.moveTo(x, y, self))
     self.pathStr.append(PathElement.lineTo(x + w, y, self))
     self.pathStr.append(PathElement.lineTo(x + w, y + h, self))
     self.pathStr.append(PathElement.lineTo(x, y + h, self))
     self.pathStr.append(PathElement.closePath())
     self.currentX = x
     self.currentY = y + h
Example #2
0
 def rect(self, x, y, w, h):
     self.pathStr.append(PathElement.moveTo(x, y, self))
     self.pathStr.append(PathElement.lineTo(x + w, y, self))
     self.pathStr.append(PathElement.lineTo(x + w, y + h, self))
     self.pathStr.append(PathElement.lineTo(x, y + h, self))
     self.pathStr.append(PathElement.closePath())
     self.currentX = x
     self.currentY = y + h
Example #3
0
 def quadraticCurveTo(self, cpx, cpy, x, y):
     cp1x = (self.currentX + 2.0 / 3.0 * (cpx - self.currentX))
     cp1y = (self.currentY + 2.0 / 3.0 * (cpy - self.currentY))
     cp2x = (cp1x + (x - self.currentX) / 3.0)
     cp2y = (cp1y + (y - self.currentY) / 3.0)
     self.pathStr.append(PathElement.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, self))
     self.currentX = x
     self.currentY = y
 def quadraticCurveTo(self, cpx, cpy, x, y):
     cp1x = (self.currentX + 2.0 / 3.0 * (cpx - self.currentX))
     cp1y = (self.currentY + 2.0 / 3.0 * (cpy - self.currentY))
     cp2x = (cp1x + (x - self.currentX) / 3.0)
     cp2y = (cp1y + (y - self.currentY) / 3.0)
     self.pathStr.append(PathElement.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, self))
     self.currentX = x
     self.currentY = y
Example #5
0
 def closePath(self):
     self.pathStr.append(PathElement.closePath())
Example #6
0
 def arc(self, x, y, radius, startAngle, endAngle, anticlockwise):
     self.pathStr.append(PathElement.arc(x, y, radius, startAngle, endAngle,
                                         anticlockwise, self))
Example #7
0
 def moveTo(self, x, y):
     self.pathStr.append(PathElement.moveTo(x, y, self))
     self.currentX = x
     self.currentY = y
Example #8
0
 def cubicCurveTo(self, cp1x, cp1y, cp2x, cp2y, x, y):
     self.pathStr.append(PathElement.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, self))
     self.currentX = x
     self.currentY = y
Example #9
0
 def cubicCurveTo(self, cp1x, cp1y, cp2x, cp2y, x, y):
     self.pathStr.append(
         PathElement.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, self))
     self.currentX = x
     self.currentY = y
Example #10
0
 def closePath(self):
     self.pathStr.append(PathElement.closePath())
Example #11
0
 def arc(self, x, y, radius, startAngle, endAngle, anticlockwise):
     self.pathStr.append(
         PathElement.arc(x, y, radius, startAngle, endAngle, anticlockwise,
                         self))
Example #12
0
 def moveTo(self, x, y):
     self.pathStr.append(PathElement.moveTo(x, y, self))
     self.currentX = x
     self.currentY = y