개정판 bd01c28e
fix grid, fix item move
Change-Id: I786ac820c0cbde27ce9edbe1e011223f2a22290b
DTI_PID/DTI_PID/QtImageViewerScene.py | ||
---|---|---|
379 | 379 |
|
380 | 380 |
self._mouse_pos = event.scenePos() |
381 | 381 |
|
382 |
super().mouseMoveEvent(event) |
|
383 |
|
|
382 | 384 |
def mouseReleaseEvent(self, event: 'QGraphicsSceneMouseEvent') -> None: |
383 | 385 |
from MoveCommand import MoveCommand |
384 | 386 |
|
DTI_PID/DTI_PID/Shapes/EngineeringTextItem.py | ||
---|---|---|
372 | 372 |
if change == QGraphicsItem.ItemPositionHasChanged: |
373 | 373 |
|
374 | 374 |
scene_origin = self.sceneBoundingRect() |
375 |
self.loc = [round(scene_origin.x(), 1), round(scene_origin.y(), 1)] |
|
375 |
configs = AppDocData.instance().getConfigs('Data', 'Grid') |
|
376 |
grid = int(configs[0].value) if 1 == len(configs) else -1 |
|
377 |
if grid == 1: |
|
378 |
self.loc = [round(scene_origin.x()), round(scene_origin.y())] |
|
379 |
else: |
|
380 |
self.loc = [round(scene_origin.x(), 1), round(scene_origin.y(), 1)] |
|
376 | 381 |
|
377 | 382 |
if hasattr(self.scene(), 'contents_changed'): |
378 | 383 |
self.scene().contents_changed.emit() |
내보내기 Unified diff