コード例 #1
0
	def LineTo(self):
		y, x = self.get_struct('<hh')
		p = self.trafo(x, y)
#		self.prop_stack.AddStyle(self.curstyle.copy())
#		self.prop_stack.SetProperty(fill_pattern=EmptyPattern)
		self.set_style(self.curstyle.copy())
		self.style.fill_pattern = EmptyPattern
		path = CreatePath()
		path.AppendLine(self.curpoint)
		path.AppendLine(p)
		self.bezier((path,))
		self.curpoint = p
		self._print('->', self.curpoint)
コード例 #2
0
	def Polygon(self):
		points = self.read_points(self.get_int16())
		if points:
			path = CreatePath()
			map(path.AppendLine, points)
			if path.Node(-1) != path.Node(0):
				#print 'correct polygon'
				path.AppendLine(path.Node(0))
			path.load_close()
#			self.prop_stack.AddStyle(self.curstyle.copy())
			self.set_style(self.curstyle.copy())
			self.bezier((path,))
コード例 #3
0
	def PolyPolygon(self):
		nr_of_polygons = self.get_int16()
		nr_of_points = []
		for i in range(nr_of_polygons):
			nr_of_points.append(self.get_int16())
		path = ()
		for i in nr_of_points:
			points = self.read_points(i)
			if points:
				subpath = CreatePath()
				map(subpath.AppendLine, points)
				if subpath.Node(-1) != subpath.Node(0):
					subpath.AppendLine(subpath.Node(0))
				subpath.load_close()
				path = path + (subpath,)
		if path:
#			self.prop_stack.AddStyle(self.curstyle.copy())
			self.set_style(self.curstyle.copy())
			self.bezier(path)