Show cursor coordinates in status bar
This commit is contained in:
@@ -104,6 +104,12 @@ class Canvas(QWidget):
|
||||
"""Update line with last point and current coordinates."""
|
||||
pos = self.transformPos(ev.pos())
|
||||
|
||||
# Update coordinates in status bar if image is opened
|
||||
window = self.parent().window()
|
||||
if window.filePath is not None:
|
||||
self.parent().window().labelCoordinates.setText(
|
||||
'X: %d; Y: %d' % (pos.x(), pos.y()))
|
||||
|
||||
# Polygon drawing.
|
||||
if self.drawing():
|
||||
self.overrideCursor(CURSOR_DRAW)
|
||||
|
||||
Reference in New Issue
Block a user