개정판 c41ba341
fix text owner indicator
Change-Id: I562f4c88989ab5d78ee594b9ad980a9aeffa43db
DTI_PID/DTI_PID/Shapes/EngineeringTextItem.py | ||
---|---|---|
358 | 358 |
@date 2018.07.08 |
359 | 359 |
''' |
360 | 360 |
def paint(self, painter, options=None, widget=None): |
361 |
import math |
|
362 |
|
|
361 | 363 |
painter.setClipRect(options.exposedRect) |
362 | 364 |
|
363 | 365 |
self.setColor(self.getColor()) |
... | ... | |
375 | 377 |
center2 = self.owner.sceneBoundingRect().center() |
376 | 378 |
dx = center2.x() - center.x() |
377 | 379 |
dy = center2.y() - center.y() |
380 |
if self.angle == 1.57: |
|
381 |
rad = 90 * (math.pi / 180.0) |
|
382 |
nx = math.cos(rad) * dx - math.sin(rad) * dy |
|
383 |
ny = math.sin(rad) * dx + math.cos(rad) * dy |
|
384 |
dx, dy = nx, ny |
|
378 | 385 |
painter.drawLine(rect.center().x(), rect.center().y(), rect.center().x() + dx, rect.center().y() + dy) |
379 | 386 |
|
380 | 387 |
painter.setFont(self.font()) |
내보내기 Unified diff