Skip to content

Commit

Permalink
Fix issue with re-rendering display_list elements
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinL10 committed Aug 26, 2023
1 parent 4572113 commit 3a5817d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions browser/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def get_font(size, weight, slant):
key = (size, weight, slant)
if key not in FONTS:
FONTS[(size, weight, slant)] = tkinter.font.Font(
family="Times",
size=size,
weight=weight,
slant=slant,
Expand Down Expand Up @@ -121,7 +120,6 @@ def paint(self, display_list):
child.paint(display_list)

for x, y, word, font in self.display_list:
print(word)
display_list.append(DrawText(x, y, word, font))

"""
Expand Down Expand Up @@ -185,7 +183,6 @@ def layout(self):
# Recursively layout each block child
for child in self.children:
child.layout()
self.display_list.extend(child.display_list)

if mode == "block":
self.height = sum([child.height for child in self.children])
Expand Down Expand Up @@ -262,7 +259,7 @@ def flush(self):
metrics = [font.metrics() for x, word, font in self.line]
max_ascent = max([metric["ascent"] for metric in metrics])
max_descent = max([metric["descent"] for metric in metrics])
baseline = self.cursor_y + max_ascent
baseline = self.cursor_y + 1.25 * max_ascent

for rel_x, word, font in self.line:
x = self.x + rel_x
Expand Down

0 comments on commit 3a5817d

Please sign in to comment.