def norm_lines(self, timeline: Timeline, rect: QRectF) -> None:
from ...main.timeline import Timeline
y = rect.top()
y_t = y + rect.height() - 1
# fastpaths for Notches that match Timeline.Mode
if timeline.mode == Timeline.Mode.FRAME:
try:
for notch in self:
x = timeline.c_to_x(notch.data) # type: ignore
notch.line = QLineF(x, y, x, y_t)
return
except Exception:
try:
for notch in self:
x = timeline.t_to_x(notch.data) # type: ignore
notch.line = QLineF(x, y, x, y_t)
return
except Exception:
...
else:
try:
for notch in self:
x = timeline.t_to_x(notch.data) # type: ignore
notch.line = QLineF(x, y, x, y_t)
return
except Exception:
try:
for notch in self:
x = timeline.c_to_x(notch.data) # type: ignore
notch.line = QLineF(x, y, x, y_t)
return
except Exception:
...
for notch in self:
if isinstance(notch.data, Frame):
x = timeline.c_to_x(notch.data)
elif isinstance(notch.data, Time):
x = timeline.t_to_x(notch.data)
notch.line = QLineF(x, y, x, y_t)