traylayout: set size of canvas

This commit is contained in:
Florian Festi 2016-04-19 09:49:58 +02:00
parent dad830d775
commit 3086485a25
1 changed files with 13 additions and 5 deletions

View File

@ -91,18 +91,26 @@ class Layout(Boxes):
edge(length)
def render(self):
self.open(1000, 600)
self.hi = hi = self.hi or self.h
self.edges["s"] = boxes.edges.Slot(self, self.hi/2.0)
self.edges["C"] = boxes.edges.CrossingFingerHoleEdge(self, self.hi)
lx = len(self.x)
ly = len(self.y)
t = self.thickness
t2 = self.thickness / 2.0
hasfloor = False
for line in self.floors:
for f in line:
hasfloor |= f
self.open(max((lx+1)*sum(self.y), (ly+1)*sum(self.x))+lx*ly*4*t,
2*self.h + hasfloor*sum(self.y) + 12*t)
self.edges["s"] = boxes.edges.Slot(self, self.hi/2.0)
self.edges["C"] = boxes.edges.CrossingFingerHoleEdge(self, self.hi)
self.ctx.save()
# Horizontal Walls