프로젝트

일반

사용자정보

개정판 1c52cea0

ID1c52cea04fa107afcd0003fe38b3bef670a9a713
상위 8a22a0ed
하위 e187f024, d697b373

함의성이(가) 약 5년 전에 추가함

issue #506: fix text edit

Change-Id: Id99c4e4750244fcac5719b0295015a2376450bcd

차이점 보기:

DTI_PID/DTI_PID/CodeTables.py
17 17
    def __init__(self, name, values):
18 18
        self.name = name
19 19
        if self.name != "NOMINALDIAMETER":
20
            self.values = [(x[0], x[1], x[2], x[3].replace(' ', '').split(',')) for x in values]
20
            self.values = [(x[0], x[1], x[2], sorted(x[3].replace(' ', '').split(','), key=lambda param:len(param), reverse=True)) for x in values]
21 21
        else:
22 22
            self.values = values
23 23

  
DTI_PID/DTI_PID/Shapes/EngineeringTextItem.py
352 352
        """edit text by using ocr dialog"""
353 353
        from TextItemFactory import TextItemFactory
354 354
        from OcrResultDialog import QOcrResultDialog
355
        from App import App
355 356

  
356 357
        item = None
357 358
        try:
......
366 367
                    item = QEngineeringTextItem.create_text_with(self.scene(), text_info)
367 368
                    if item:
368 369
                        item.area = self.area
369
                        item.transfer.onRemoved.connect(self.transfer.onRemoved)
370
                        item.transfer.onRemoved.connect(App.mainWnd().itemRemoved)
370 371

  
371 372
                self.transfer.onRemoved.emit(self)
372 373
        except Exception as ex:
DTI_PID/DTI_PID/tesseract_ocr_module.py
210 210
            # up to here
211 211
            if minSize <= rect.height() <= maxSize:  # TODO: 이 부분이 필요한가?
212 212
                text_rect = QRect(rect.left(), imgHeight - rect.bottom(), rect.width(), rect.height())
213
                if text_rect.width() < 5 or text_rect.height() < 5:
214
                    continue
213 215
                if angle == 90 or angle == 270:
214 216
                    transform = QTransform()
215 217
                    transform.translate(imgHeight * 0.5, imgWidth * 0.5)

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)