@@ -1913,7 +1913,7 @@ def __toggleNewArrowAnnotation(self, checked):
19131913 handler = self .__scene .user_interaction_handler
19141914 if isinstance (handler , interactions .NewArrowAnnotation ):
19151915 # Cancel the interaction and restore the state
1916- handler .ended .disconnect (action . toggle )
1916+ handler .ended .disconnect (self . __toggleNewArrowAction )
19171917 handler .cancel (interactions .UserInteraction .UserCancelReason )
19181918 log .info ("Canceled new arrow annotation" )
19191919
@@ -1922,10 +1922,18 @@ def __toggleNewArrowAnnotation(self, checked):
19221922 checked_action = self .__arrowColorActionGroup .checkedAction ()
19231923 handler .setColor (checked_action .data ())
19241924
1925- handler .ended .connect (action . toggle )
1925+ handler .ended .connect (self . __toggleNewArrowAction )
19261926
19271927 self ._setUserInteractionHandler (handler )
19281928
1929+ def __toggleNewArrowAction (self ):
1930+ handler = self .sender ()
1931+ action = self .__newArrowAnnotationAction
1932+ action .toggle () # end current
1933+ if handler .extendedOnShift :
1934+ handler .extendedOnShift = False # clear shift flag
1935+ action .toggle () # start new
1936+
19291937 def __onFontSizeTriggered (self , action ):
19301938 # type: (QAction) -> None
19311939 if not self .__newTextAnnotationAction .isChecked ():
0 commit comments