age support fix

This commit is contained in:
Q
2025-08-13 19:00:40 +03:00
parent 1d81485503
commit 4c522db2ac

View File

@@ -434,7 +434,17 @@ class Marker:
)
return value
return {"x0": None, "y0": None, "x1": None, "y1": None, "cx": None, "cy": None, "visible": 0, "type": None, "age": None}
return {
"x0": None,
"y0": None,
"x1": None,
"y1": None,
"cx": None,
"cy": None,
"visible": 0,
"type": None,
"age": None,
}
def modify_point(self, position, x, y):
"""position: tl topleft, br bottomright, c center"""
@@ -615,7 +625,7 @@ class World:
if self.plugin:
self.plugin(self)
def interpolate_points(self, point_index = None):
def interpolate_points(self, point_index=None):
"""types:
key: user clicked / accepted frame
interp: interpolated frame
@@ -627,7 +637,7 @@ class World:
point_index = self.point_index
def i_point(x0=None, y0=None, x1=None, y1=None, t=None, visible=None, age=None):
return {"x0": x0, "y0": y0, "x1": x1, "y1": y1, "type": t, "visible": visible, "age"=age}
return {"x0": x0, "y0": y0, "x1": x1, "y1": y1, "type": t, "visible": visible, "age": age}
def point2array(p):
@@ -688,7 +698,7 @@ class World:
# clicked points (not necessary, could determine at draw time!)
for key in point_keys:
self.points_interpolated[point_index][key]["type"] = "key"
age=0
age = 0
for key in self.points_interpolated[point_index]:
if self.points_interpolated[point_index][key]["type"] == "key":
age = 0
@@ -881,7 +891,7 @@ class World:
keys = list(self.points.keys())
for index in keys:
# Remove empty dicts
if len(self.points[index])==0:
if len(self.points[index]) == 0:
del self.points[index]
continue
self.point_index = index