During creation of an occurrence, the rectangle is not updated when the double click is on the opposite side of the cursor
This seems to be a convoluted problem. Both classes Occurrence
and ZoomableGraphicsView
respond to mouseDoubleClickEvent
. The former performs actions only when there is no occurrence under creation. The latter:
- computes the time associated with the position clicked and passes it to
Video.set_position
. -
Video.set_position
computes the position, in pixels, and passes it toZoomableGraphicsView.set_position
. -
ZoomableGraphicsView.set_position
does three things:- If there is an occurrence under creation, it calls method
get_time_from_bounding_interval
for that occurrence. Essentially, this method limits its time argument to the feasible interval and returns the new bounded value. - Do the same thing for the selected item, if it is an occurrence.
- Call the method
Video.media_player.setPosition
, passing as argument the value of time.
- If there is an occurrence under creation, it calls method
- Changing the MediaPlayer position triggers the call to method
Video.position_changed
, which setsTimePane.time
. - Changing the time of the
TimePane
causes methodTimePane.on_time_changed
to be called. - This method finally calls the methods
Occurrence.update_begin_time
andOccurrence.update_beginend_time
, which change the appearance of the occurence rectangle.
This huge ping-pong between class can probably be improved. At any rate, the problem seems to be in method TimePane.on_time_changed
.