Commit 8a987a4b authored by minicom's avatar minicom
Browse files

fix full-width character processing bug

(cherry picked from commit e953d8bdf68718a1775e0b0a86dbd76a27b96b64)
parent b64e41c6
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -72,13 +72,13 @@ class TextBlkItem(QGraphicsTextItem):
        self.setCacheMode(QGraphicsItem.CacheMode.DeviceCoordinateCache)

    def inputMethodEvent(self, e: QInputMethodEvent):
        if self.pre_editing == False:
            cursor = self.textCursor()
            self.input_method_from = cursor.selectionStart()
        if e.preeditString() == '':
            self.pre_editing = False
            self.input_method_text = e.commitString()
        else:
            if self.pre_editing == False:
                cursor = self.textCursor()
                self.input_method_from = cursor.selectionStart()
            self.pre_editing = True
        super().inputMethodEvent(e)
        
@@ -412,7 +412,7 @@ class TextBlkItem(QGraphicsTextItem):
        if not self.pre_editing:
            if self.hasFocus():
                self.change_from = from_
                self.change_added = added
                self.change_added = added - removed

    def keyPressEvent(self, e: QKeyEvent) -> None: