We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 019635d commit b7fa6c7Copy full SHA for b7fa6c7
src/opentimelineview/ruler_widget.py
@@ -174,10 +174,15 @@ def map_to_time_space(self, item):
174
is_head = False
175
is_tail = False
176
f = "-?-"
177
+ ratio = -1.0
178
+ width = float(item.rect().width())
179
- ratio = (self.x() - item.x() +
- track_widgets.CURRENT_ZOOM_LEVEL *
180
- track_widgets.TRACK_NAME_WIDGET_WIDTH) / float(item.rect().width())
+ if width > 0.0:
181
+ ratio = (self.x() - item.x() +
182
+ track_widgets.CURRENT_ZOOM_LEVEL *
183
+ track_widgets.TRACK_NAME_WIDGET_WIDTH) / width
184
+ else:
185
+ print("Warning: zero width item: {}.".format(item))
186
187
# The 'if' condition should be : ratio < 0 or ration >= 1
188
# However, we are cheating in order to display the last frame of
0 commit comments