diff --git a/src/windows/views/webview.py b/src/windows/views/webview.py index d45d85308a..1afb451090 100644 --- a/src/windows/views/webview.py +++ b/src/windows/views/webview.py @@ -388,15 +388,20 @@ def update_transition_data(self, transition_json, only_basic_props=True, # For example, the left side of a clip, or the right side, so we can determine # which direction the wipe should be moving in is_forward_direction = True + diff_from_edge = 9999 for intersecting_clip in Clip.filter(intersect=position, layer=layer): - log.debug(f"Intersecting Clip: {intersecting_clip}") diff_from_start = abs(intersecting_clip.data.get("position", 0.0) - position) diff_from_end = abs((intersecting_clip.data.get("position", 0.0) + \ (intersecting_clip.data.get("end", 0.0) - intersecting_clip.data.get("start", 0.0))) \ - position) - if diff_from_end < diff_from_start: - is_forward_direction = False - log.debug(f"Is transition moving a forward direction? {is_forward_direction}") + smallest_diff = min(diff_from_start, diff_from_end) + if smallest_diff < diff_from_edge: + diff_from_edge = smallest_diff + if diff_from_end < diff_from_start: + is_forward_direction = False + else: + is_forward_direction = True + log.debug(f"Is transition moving in a forward direction? {is_forward_direction}") # Determine existing brightness and contrast ranges (if any) brightness_range = []