(self, newpos, blackboard)
This functions makes sure the current end being dragged follows the
            cursor. It also checks for type safety and changes the line color
            if needed.
This functions makes sure the current end being dragged follows the
            cursor. It also checks for type safety and changes the line color
            if needed.
This functions makes sure the current end being dragged follows the cursor . It also checks for type safety and changes the line color if needed .
def follow_cursor(self, newpos, blackboard):
        """ This functions makes sure the current end being dragged follows the
            cursor. It also checks for type safety and changes the line color
            if needed."""
        if self.forward:
            fixed_edge = self.start
            self.bez_end = [*newpos]
            self._rebezier()
        else:
            fixed_edge = self.end
            self.bez_start = [*newpos]
            self._rebezier()
        self.info.pos = [*newpos]
        # The conditionals are so complicated because it is necessary to check
        # whether or not a pin in a block has been touched, and then check
        # the typesafety.
        if (self._in_pin(blackboard, newpos) and
            not self._in_pin(blackboard, newpos).typesafe(fixed_edge)):
            # This conditional represents that the cursor stepped out the pin
            self.info.text = 'Connection is not possible'
            self._warn()
        elif (self._in_pin(blackboard, newpos) and
              self._in_pin(blackboard, newpos).typesafe(fixed_edge)):
            self.info.text = 'Connect'
            if self.warned:
                self._unwarn()
        else:
            self.info.text = 'Spawn new block'
            if self.warned:
                self._unwarn()
def follow_cursor ( self , newpos , blackboard ) : if self . forward : fixed_edge = self . start self . bez_end = [ * newpos ] self . _rebezier ( ) else : fixed_edge = self . end self . bez_start = [ * newpos ] self . _rebezier ( ) self . info . pos = [ * newpos ] # The conditionals are so complicated because it is necessary to check # whether or not a pin in a block has been touched, and then check # the typesafety. if ( self . _in_pin ( blackboard , newpos ) and not self . _in_pin ( blackboard , newpos ) . typesafe ( fixed_edge ) ) : # This conditional represents that the cursor stepped out the pin self . info . text = 'Connection is not possible' self . _warn ( ) elif ( self . _in_pin ( blackboard , newpos ) and self . _in_pin ( blackboard , newpos ) . typesafe ( fixed_edge ) ) : self . info . text = 'Connect' if self . warned : self . _unwarn ( ) else : self . info . text = 'Spawn new block' if self . warned : self . _unwarn ( )