개정판 9aad8391
eq scale flip fix
Change-Id: I71b0a3f5a8daa62fda5888165802ff30bda9bbb9
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
761 | 761 |
transform = QTransform().translate(self.symbolOrigin[0], self.symbolOrigin[1]) |
762 | 762 |
transform.scale(scale[0], scale[1]) |
763 | 763 |
transform.translate(-self.symbolOrigin[0], -self.symbolOrigin[1]) |
764 |
if self.flip == 1: |
|
765 |
transform.scale(-1.0, 1.0) |
|
766 |
transform.translate(-2 * self.symbolOrigin[0], 0) |
|
764 | 767 |
self.setTransform(transform) |
765 | 768 |
else: |
766 | 769 |
self.setScale(scale[0]) |
770 |
if self.flip == 1: |
|
771 |
transform = QTransform() |
|
772 |
transform.scale(-1.0, 1.0) |
|
773 |
transform.translate(-2 * self.symbolOrigin[0], 0) |
|
774 |
self.setTransform(transform) |
|
767 | 775 |
|
768 | 776 |
# setting connectors |
769 | 777 |
connectionPoints = symbolInfo.getConnectionPoint().split('/') |
... | ... | |
2648 | 2656 |
|
2649 | 2657 |
def addSvgItemToScene(self, scene, undoable: bool = False, manual=False) -> None: |
2650 | 2658 |
"""Add Svg Item into ImageViewer's Scene""" |
2651 |
if self.flip: |
|
2652 |
self.flip_symbol() |
|
2659 |
#if self.flip:
|
|
2660 |
# self.flip_symbol()
|
|
2653 | 2661 |
|
2654 | 2662 |
if (hasattr(self, 'symbolConvertingOrigin') and not self.symbolConvertingOrigin) or not manual: |
2655 | 2663 |
self.setTransformOriginPoint(QPointF(self.symbolOrigin[0], self.symbolOrigin[1])) |
... | ... | |
2746 | 2754 |
|
2747 | 2755 |
def flip_symbol(self) -> None: |
2748 | 2756 |
"""flip symbol""" |
2749 |
transform = QTransform() |
|
2750 |
if self.flip is 1: |
|
2751 |
rect = self.boundingRect() |
|
2757 |
|
|
2758 |
from EngineeringEquipmentItem import QEngineeringEquipmentItem |
|
2759 |
|
|
2760 |
if type(self) is QEngineeringEquipmentItem: |
|
2761 |
transform = QTransform().translate(self.symbolOrigin[0], self.symbolOrigin[1]) |
|
2762 |
transform.scale(self.transform().m11(), self.transform().m22()) |
|
2763 |
transform.translate(-self.symbolOrigin[0], -self.symbolOrigin[1]) |
|
2752 | 2764 |
transform.scale(-1.0, 1.0) |
2753 | 2765 |
transform.translate(-2 * self.symbolOrigin[0], 0) |
2766 |
else: |
|
2767 |
transform = QTransform() |
|
2768 |
if self.flip is 1: |
|
2769 |
#rect = self.boundingRect() |
|
2770 |
transform.scale(-1.0, 1.0) |
|
2771 |
transform.translate(-2 * self.symbolOrigin[0], 0) |
|
2754 | 2772 |
|
2755 | 2773 |
self.setTransform(transform) |
2756 | 2774 |
|
내보내기 Unified diff