|
|
@ -1,4 +1,6 @@ |
|
|
|
import re |
|
|
|
import re |
|
|
|
|
|
|
|
import time |
|
|
|
|
|
|
|
|
|
|
|
import pyray as rl |
|
|
|
import pyray as rl |
|
|
|
from dataclasses import dataclass |
|
|
|
from dataclasses import dataclass |
|
|
|
from enum import Enum |
|
|
|
from enum import Enum |
|
|
@ -191,6 +193,7 @@ class HtmlRenderer(Widget): |
|
|
|
return current_y - rect.y |
|
|
|
return current_y - rect.y |
|
|
|
|
|
|
|
|
|
|
|
def get_total_height(self, content_width: int) -> float: |
|
|
|
def get_total_height(self, content_width: int) -> float: |
|
|
|
|
|
|
|
t = time.monotonic() |
|
|
|
total_height = 0.0 |
|
|
|
total_height = 0.0 |
|
|
|
padding = 20 |
|
|
|
padding = 20 |
|
|
|
usable_width = content_width - (padding * 2) |
|
|
|
usable_width = content_width - (padding * 2) |
|
|
@ -211,6 +214,7 @@ class HtmlRenderer(Widget): |
|
|
|
|
|
|
|
|
|
|
|
total_height += element.margin_bottom |
|
|
|
total_height += element.margin_bottom |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print(f"HtmlRenderer.get_total_height took {(time.monotonic() - t) * 1000:.4f}ms") |
|
|
|
return total_height |
|
|
|
return total_height |
|
|
|
|
|
|
|
|
|
|
|
def _get_font(self, weight: FontWeight): |
|
|
|
def _get_font(self, weight: FontWeight): |
|
|
|