개정판 4fd4c77d
issue #501: fix add symbol to scene manual position
DTI_PID/DTI_PID/QtImageViewer.py | ||
---|---|---|
563 | 563 |
connPts = [(float(x.split(',')[0]), float(x.split(',')[1])) if len(x.split(',')) == 2 else (x.split(',')[0], float(x.split(',')[1]), float(x.split(',')[2])) \ |
564 | 564 |
for x in strConnPts.split('/')] |
565 | 565 |
|
566 |
svg.buildItem(svgFileName, symbol.getType(), 0, None, None, [float(x) for x in symbol.getOriginalPoint().split(',')], connPts, symbol.getBaseSymbol(), symbol.getAdditionalSymbol(), symbol.getHasInstrumentLabel())
|
|
566 |
svg.buildItem(svgFileName, symbol.getType(), 0, None, None, None, connPts, symbol.getBaseSymbol(), symbol.getAdditionalSymbol(), symbol.getHasInstrumentLabel())
|
|
567 | 567 |
|
568 | 568 |
return svg |
569 | 569 |
|
... | ... | |
587 | 587 |
transform = QTransform() |
588 | 588 |
transform.translate(scenePos.x() - svg.symbolOrigin[0], scenePos.y() - svg.symbolOrigin[1]) |
589 | 589 |
svg.setTransform(transform) |
590 |
svg.loc = [scenePos.x() - svg.symbolOrigin[0], scenePos.y() - svg.symbolOrigin[1]]
|
|
590 |
svg.loc = [round(scenePos.x() - svg.symbolOrigin[0], 1), round(scenePos.y() - svg.symbolOrigin[1], 1)]
|
|
591 | 591 |
svg.size = [svg.boundingRect().width(), svg.boundingRect().height()] |
592 |
svg.origin = [round(scenePos.x(), 1), round(scenePos.y(), 1)] |
|
592 | 593 |
self.scene.addItem(svg) |
593 | 594 |
|
594 | 595 |
svg.transfer.onRemoved.connect(self.mainWindow.itemRemoved) |
내보내기 Unified diff