개정판 0ad1d9ae
issue #538: fix rotate and test
Change-Id: I0ff7ada64f14f6e2a783050482c93265838b9694
DTI_PID/DTI_PID/Commands/RotateCommand.py | ||
---|---|---|
41 | 41 |
angle = item.rotation() |
42 | 42 |
_params.append(angle) |
43 | 43 |
item.rotate(math.radians((angle + 90) % 360 if angle in [0, 90, 180, 270, 360] else 0)) |
44 |
item.angle = math.radians(item.rotation()) |
|
44 | 45 |
|
45 | 46 |
self._params = _params |
46 | 47 |
self._scene.update() |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
2040 | 2040 |
for connector in target_symbol.connectors: |
2041 | 2041 |
svg = self.graphicsView.createSymbolObject(symName) |
2042 | 2042 |
if len(svg.connectors) > 1: |
2043 |
if target_symbol.connectors.index(connector) in index and \
|
|
2043 |
if ((target_symbol.conn_type and target_symbol.connectors.index(connector) in index) or not target_symbol.conn_type) and \
|
|
2044 | 2044 |
(not connector.connectedItem or (connector.connectedItem and type(connector.connectedItem) is QEngineeringLineItem)): |
2045 | 2045 |
self.graphicsView.matchSymbolToLine(svg, connector.sceneBoundingRect().center()) |
2046 | 2046 |
elif len(svg.connectors) == 1: |
2047 |
if target_symbol.connectors.index(connector) in index and not connector.connectedItem: |
|
2047 |
if ((target_symbol.conn_type and target_symbol.connectors.index(connector) in index) or not target_symbol.conn_type) and \ |
|
2048 |
not connector.connectedItem: |
|
2048 | 2049 |
self.graphicsView.matchSymbolToLine(svg, connector.sceneBoundingRect().center()) |
2049 | 2050 |
|
2050 | 2051 |
if target_symbol: |
DTI_PID/DTI_PID/ReplaceSymbolDialog.py | ||
---|---|---|
107 | 107 |
targets = [] |
108 | 108 |
for item in items: |
109 | 109 |
for conn in item.connectors[:2]: |
110 |
if conn.parentItem().has_connection and not conn.connectedItem and package.includes(conn, margin = 50):
|
|
110 |
if conn.parentItem().has_connection and not conn.connectedItem and package.includes(conn, margin = 100):
|
|
111 | 111 |
matches = [target for target in targets if target.parentItem() is conn.parentItem()] |
112 | 112 |
if not matches: |
113 | 113 |
targets.append(conn) |
내보내기 Unified diff