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