traylayout: set size of canvas
This commit is contained in:
parent
dad830d775
commit
3086485a25
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue