Fix start of viewport to x=0

as we do not have the place to write a different value anyway.
This fixes the scaling in x direction: gh#7
This commit is contained in:
Florian Festi 2016-06-22 10:47:47 +02:00
parent 200f473747
commit 43c34e6a42
1 changed files with 6 additions and 1 deletions

View File

@ -69,7 +69,12 @@ class SVGFile(object):
m = re.search(r"""<svg[^>]*width="(\d+pt)" height="(\d+pt)" viewBox="0 (0 (\d+) (\d+))" version="1.1">""", s)
minx = 10*int(self.minx//10)-10
#minx = 10*int(self.minx//10)-10
# as we don't rewrite the left border keep it as 0
if 0 <= self.minx <= 50:
minx = 0
else:
raise ValueError("Left end of drawing at wrong place: %imm (0-50mm expected)" % self.minx)
maxx = 10*int(self.maxx//10)+10
miny = 10*int(self.miny//10)-10
maxy = 10*int(self.maxy//10)+10