def mouseUp(self, evt, pos, direction):
        """
        Called on releasing the Mouse Button.
        Creates Operation object and passes it to the leveleditor.
        """
        if not self.draggedPositions:
            return
        op = BrushOperation(self)
        self.editor.addOperation(op)
        if op.canUndo:
            self.editor.addUnsavedEdit()
        self.editor.invalidateBox(op.dirtyBox())
        if self.draggedPositions:
            self.lastPosition = self.draggedPositions[-1]
            self.draggedPositions = []

        Called on releasing the Mouse Button.
        Creates Operation object and passes it to the leveleditor.
        
editortools/brush.py