개정판 2c7b34fc
eq scale key change
Change-Id: I0304e90b9353c61ff44e0b333554dd142ef60327
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
1304 | 1304 |
del self._scale_x |
1305 | 1305 |
''' |
1306 | 1306 |
elif event.key() == Qt.Key_Up: # translate up/down/left/right symbol |
1307 |
delta = 10 if modifiers == Qt.ControlModifier else 1 |
|
1307 |
if modifiers == Qt.AltModifier and type(self) is QEngineeringEquipmentItem: |
|
1308 |
transform = QTransform().translate(self.symbolOrigin[0], self.symbolOrigin[1]) |
|
1309 |
transform.scale(self.transform().m11(), self.transform().m22() + 0.1) |
|
1310 |
transform.translate(-self.symbolOrigin[0], -self.symbolOrigin[1]) |
|
1311 |
self.setTransform(transform) |
|
1312 |
else: |
|
1313 |
delta = 10 if modifiers == Qt.ControlModifier else 1 |
|
1308 | 1314 |
|
1309 |
#self.loc[1] = self.loc[1] - delta |
|
1310 |
#self.origin[1] = self.origin[1] - delta |
|
1311 |
self.moveBy(0, -delta) |
|
1315 |
#self.loc[1] = self.loc[1] - delta
|
|
1316 |
#self.origin[1] = self.origin[1] - delta
|
|
1317 |
self.moveBy(0, -delta)
|
|
1312 | 1318 |
elif event.key() == Qt.Key_Down: |
1313 |
delta = 10 if modifiers == Qt.ControlModifier else 1 |
|
1319 |
if modifiers == Qt.AltModifier and type(self) is QEngineeringEquipmentItem: |
|
1320 |
transform = QTransform().translate(self.symbolOrigin[0], self.symbolOrigin[1]) |
|
1321 |
transform.scale(self.transform().m11(), self.transform().m22() - 0.1 if self.transform().m22() - 0.1 > 0.3 else 0.3) |
|
1322 |
transform.translate(-self.symbolOrigin[0], -self.symbolOrigin[1]) |
|
1323 |
self.setTransform(transform) |
|
1324 |
else: |
|
1325 |
delta = 10 if modifiers == Qt.ControlModifier else 1 |
|
1314 | 1326 |
|
1315 |
#self.loc[1] = self.loc[1] + delta |
|
1316 |
#self.origin[1] = self.origin[1] + delta |
|
1317 |
self.moveBy(0, delta) |
|
1327 |
#self.loc[1] = self.loc[1] + delta
|
|
1328 |
#self.origin[1] = self.origin[1] + delta
|
|
1329 |
self.moveBy(0, delta)
|
|
1318 | 1330 |
elif event.key() == Qt.Key_Left: |
1319 |
delta = 10 if modifiers == Qt.ControlModifier else 1 |
|
1320 |
|
|
1321 |
#self.loc[0] = self.loc[0] - delta |
|
1322 |
#self.origin[0] = self.origin[0] - delta |
|
1323 |
self.moveBy(-delta, 0) |
|
1324 |
elif event.key() == Qt.Key_Right: |
|
1325 |
delta = 10 if modifiers == Qt.ControlModifier else 1 |
|
1326 |
|
|
1327 |
#self.loc[0] = self.loc[0] + delta |
|
1328 |
#self.origin[0] = self.origin[0] + delta |
|
1329 |
self.moveBy(delta, 0) |
|
1330 |
elif event.key() == Qt.Key_Plus or event.key() == 61: |
|
1331 |
if type(self) is QEngineeringEquipmentItem: |
|
1331 |
if modifiers == Qt.AltModifier and type(self) is QEngineeringEquipmentItem: |
|
1332 | 1332 |
transform = QTransform().translate(self.symbolOrigin[0], self.symbolOrigin[1]) |
1333 |
if modifiers == Qt.ControlModifier: |
|
1334 |
transform.scale(self.transform().m11(), self.transform().m22() + 0.1) |
|
1335 |
else: |
|
1336 |
transform.scale(self.transform().m11() + 0.1, self.transform().m22()) |
|
1337 |
#else: |
|
1338 |
# transform.scale(self.transform().m11() + 0.1, self.transform().m22() + 0.1) |
|
1333 |
transform.scale(self.transform().m11() - 0.1 if self.transform().m11() - 0.1 > 0.3 else 0.3, self.transform().m22()) |
|
1339 | 1334 |
transform.translate(-self.symbolOrigin[0], -self.symbolOrigin[1]) |
1340 | 1335 |
self.setTransform(transform) |
1341 | 1336 |
else: |
1342 |
self.setScale(self.scale() + 0.1) |
|
1343 |
elif event.key() == Qt.Key_Minus: |
|
1344 |
if type(self) is QEngineeringEquipmentItem: |
|
1337 |
delta = 10 if modifiers == Qt.ControlModifier else 1 |
|
1338 |
|
|
1339 |
#self.loc[0] = self.loc[0] - delta |
|
1340 |
#self.origin[0] = self.origin[0] - delta |
|
1341 |
self.moveBy(-delta, 0) |
|
1342 |
elif event.key() == Qt.Key_Right: |
|
1343 |
if modifiers == Qt.AltModifier and type(self) is QEngineeringEquipmentItem: |
|
1345 | 1344 |
transform = QTransform().translate(self.symbolOrigin[0], self.symbolOrigin[1]) |
1346 |
if modifiers == Qt.ControlModifier: |
|
1347 |
transform.scale(self.transform().m11(), self.transform().m22() - 0.1 if self.transform().m22() - 0.1 > 0.3 else 0.3) |
|
1348 |
else: |
|
1349 |
transform.scale(self.transform().m11() - 0.1 if self.transform().m11() - 0.1 > 0.3 else 0.3, self.transform().m22()) |
|
1350 |
#else: |
|
1351 |
# transform.scale(self.transform().m11() - 0.1 if self.transform().m11() - 0.1 > 0.3 else 0.3, self.transform().m22() - 0.1 if self.transform().m22() - 0.1 > 0.3 else 0.3) |
|
1345 |
transform.scale(self.transform().m11() + 0.1, self.transform().m22()) |
|
1352 | 1346 |
transform.translate(-self.symbolOrigin[0], -self.symbolOrigin[1]) |
1353 | 1347 |
self.setTransform(transform) |
1354 | 1348 |
else: |
1355 |
self.setScale(self.scale() - 0.1 if self.scale() - 0.1 > 0.3 else 0.3) |
|
1349 |
delta = 10 if modifiers == Qt.ControlModifier else 1 |
|
1350 |
|
|
1351 |
#self.loc[0] = self.loc[0] + delta |
|
1352 |
#self.origin[0] = self.origin[0] + delta |
|
1353 |
self.moveBy(delta, 0) |
|
1354 |
elif event.key() == Qt.Key_Plus or event.key() == 61: |
|
1355 |
self.setScale(self.scale() + 0.1) |
|
1356 |
elif event.key() == Qt.Key_Minus: |
|
1357 |
self.setScale(self.scale() - 0.1 if self.scale() - 0.1 > 0.3 else 0.3) |
|
1356 | 1358 |
elif event.key() == Qt.Key_I or event.key() == Qt.Key_J or event.key() == Qt.Key_Q or event.key() == Qt.Key_Insert or event.key() == Qt.Key_M: #or event.key() == Qt.Key_X |
1357 | 1359 |
from App import App |
1358 | 1360 |
|
내보내기 Unified diff