프로젝트

일반

사용자정보

개정판 5192709e

ID5192709e80ad1c0d1fb09edc41f45837c3f53194
상위 e6bea39e
하위 2574510c

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

issue #000: fix text size

Change-Id: I4f2a824a8d71cac89fac46acfeb84336f12885a3

차이점 보기:

DTI_PID/DTI_PID/Shapes/EngineeringTextItem.py
347 347
            x = self.loc[0]
348 348
            y = self.loc[1]
349 349
            rect = None
350
            lineCount = self.text().count('\n') if self.text().count('\n') is not 0 else 1
350 351
            transform = QTransform()
351 352
            if (1.57 == self.angle) or (4.71 == self.angle):
352 353
                font = QFont(fontName, width if fontSize == -1 else fontSize)
353 354
                
354 355
                x_factor = width / QFontMetricsF(font).height()
355
                y_factor = height / QFontMetricsF(font).width(self.text())
356
                y_factor = height / (QFontMetricsF(font).width(self.text()) / lineCount)
356 357
                factor = min(x_factor, y_factor)
357 358
                font.setPointSizeF(font.pointSizeF()*factor)
358 359

  
......
369 370
            elif 3.14 == self.angle:
370 371
                font = QFont(fontName, height if fontSize == -1 else fontSize)
371 372

  
372
                x_factor = width / QFontMetricsF(font).width(self.text())
373
                x_factor = width / (QFontMetricsF(font).width(self.text()) / lineCount)
373 374
                y_factor = height / QFontMetricsF(font).height()
374 375
                factor = min(x_factor, y_factor)
375 376
                font.setPointSizeF(font.pointSizeF()*factor)
......
386 387
            else:
387 388
                font = QFont(fontName, height if fontSize == -1 else fontSize)
388 389

  
389
                x_factor = width / QFontMetricsF(font).width(self.text())
390
                x_factor = width / (QFontMetricsF(font).width(self.text()) / lineCount)
390 391
                y_factor = height / QFontMetricsF(font).height()
391 392
                factor = min(x_factor, y_factor)
392 393
                font.setPointSizeF(font.pointSizeF()*factor)

내보내기 Unified diff

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