- added a protection for the case that the aperture table is part of a deleted object

This commit is contained in:
Marius Stanciu
2019-05-06 01:41:41 +03:00
parent ae775b520e
commit 4bb4a18a81
2 changed files with 35 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing.
- another fix for bug in clear geometry processing for Gerber apertures
- added a protection for the case that the aperture table is part of a deleted object
- in Script Editor added support for auto-add closing parenthesis, brace and bracket
4.05.2019

View File

@@ -576,6 +576,40 @@ class FCTextAreaExtended(QtWidgets.QTextEdit):
self.completer.insertText.emit(self.completer.getSelected())
self.completer.setCompletionMode(QCompleter.PopupCompletion)
return
elif key == Qt.Key_BraceLeft:
tc.insertText('{}')
self.moveCursor(QtGui.QTextCursor.Left)
elif key == Qt.Key_BracketLeft:
tc.insertText('[]')
self.moveCursor(QtGui.QTextCursor.Left)
elif key == Qt.Key_ParenLeft:
tc.insertText('()')
self.moveCursor(QtGui.QTextCursor.Left)
elif key == Qt.Key_BraceRight:
tc.select(QtGui.QTextCursor.WordUnderCursor)
if tc.selectedText() == '}':
tc.movePosition(QTextCursor.Right)
self.setTextCursor(tc)
else:
tc.clearSelection()
self.textCursor().insertText('}')
elif key == Qt.Key_BracketRight:
tc.select(QtGui.QTextCursor.WordUnderCursor)
if tc.selectedText() == ']':
tc.movePosition(QTextCursor.Right)
self.setTextCursor(tc)
else:
tc.clearSelection()
self.textCursor().insertText(']')
elif key == Qt.Key_ParenRight:
tc.select(QtGui.QTextCursor.WordUnderCursor)
if tc.selectedText() == ')':
tc.movePosition(QTextCursor.Right)
self.setTextCursor(tc)
else:
tc.clearSelection()
self.textCursor().insertText(')')
else:
super(FCTextAreaExtended, self).keyPressEvent(event)