Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 5
0
 def closePath(self):
     self.pathStr.append(PathElement.closePath())
Esempio n. 6
0
 def arc(self, x, y, radius, startAngle, endAngle, anticlockwise):
     self.pathStr.append(PathElement.arc(x, y, radius, startAngle, endAngle,
                                         anticlockwise, self))
Esempio n. 7
0
 def moveTo(self, x, y):
     self.pathStr.append(PathElement.moveTo(x, y, self))
     self.currentX = x
     self.currentY = y
Esempio n. 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
Esempio n. 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
Esempio n. 10
0
 def closePath(self):
     self.pathStr.append(PathElement.closePath())
Esempio n. 11
0
 def arc(self, x, y, radius, startAngle, endAngle, anticlockwise):
     self.pathStr.append(
         PathElement.arc(x, y, radius, startAngle, endAngle, anticlockwise,
                         self))
Esempio n. 12
0
 def moveTo(self, x, y):
     self.pathStr.append(PathElement.moveTo(x, y, self))
     self.currentX = x
     self.currentY = y