Fix scaling

This commit is contained in:
Florian Festi 2013-06-25 19:45:09 +02:00
parent d3e932b78c
commit 987d51a73b
1 changed files with 4 additions and 1 deletions

View File

@ -76,10 +76,13 @@ class Boxes:
self._init_surface(width, height)
def _init_surface(self, width, height):
mm2pt = 90 / 25.4 / 1.25
width *= mm2pt
height *= 3.543307
self.surface = cairo.SVGSurface(self.output, width, height)
self.ctx = ctx = cairo.Context(self.surface)
ctx.translate(0, height)
ctx.scale(1, -1)
ctx.scale(mm2pt, -mm2pt)
ctx.set_source_rgb(1.0, 1.0, 1.0)
ctx.rectangle(0, 0, width, height)