Ejemplo n.º 1
0
	def draw(self, doc, rect):
		self.doc = doc
		self.rect = rect
		self.width = self.canvas.winfo_width()
		self.height = self.canvas.winfo_height()
		self.trafo = self.canvas.get_matrix()
		self.stroke_mode = self.canvas.IsOutlineMode()
		self.zoom = abs(self.trafo[0])
		self.canvas_matrix = cairo.Matrix(*self.trafo)

		self.surface = cairo.ImageSurface(cairo.FORMAT_ARGB32,
										self.width, self.height)
		self.ctx = cairo.Context(self.surface)
		self.ctx.set_source_rgb(*CAIRO_WHITE)
		self.ctx.paint()
		self.ctx.set_matrix(self.canvas_matrix)

		#---Drawing Start
		self.draw_page()
		self.draw_layers(self.doc.getRegularLayers())
		self.draw_layers(self.doc.getMasterLayers())
		self.draw_guidelayer(self.doc.guide_layer)
		self.draw_gridlayer(self.doc.snap_grid)
		#---Drawing End

		winctx = tkcairo.create_context(self.canvas)
		winctx.set_source_surface(self.surface)
		winctx.paint()
		self.init_fields()
Ejemplo n.º 2
0
def click():
	ctx = tkcairo.create_context(frame)
	ctx.set_source_rgb(*CAIRO_WHITE)
	ctx.paint()