added support for full dynamic sizing of instruction blocks

This commit is contained in:
weckyy702
2021-01-04 17:44:16 +01:00
parent 8ba7936311
commit c7875f45d7
5 changed files with 100 additions and 41 deletions

View File

@@ -25,9 +25,15 @@ class Function_scope(Iterable):
def get_height(self) -> int:
h = 0.0
for inst in self.contents:
h += inst.getblksize()
h += inst.getblkheight()
return int(h)
def get_width(self) -> int:
w = 0.0
for inst in self.contents:
w = max(w, inst.getblkwidth())
return int(max(200, w))
def __iter__(self):
return self.contents.__iter__()