Added annotation width and height in toolbar while drawing.

This commit is contained in:
BIASUTTI Pierre 2020-01-30 12:43:14 +01:00 committed by darrenl
parent a74b00c219
commit 45078ac670

View File

@ -115,6 +115,12 @@ class Canvas(QWidget):
if self.drawing():
self.overrideCursor(CURSOR_DRAW)
if self.current:
# Display annotation width and height while drawing
currentWidth = abs(self.current[0].x() - pos.x())
currentHeight = abs(self.current[0].y() - pos.y())
self.parent().window().labelCoordinates.setText(
'Width: %d, Height: %d / X: %d; Y: %d' % (currentWidth, currentHeight, pos.x(), pos.y()))
color = self.drawingLineColor
if self.outOfPixmap(pos):
# Don't allow the user to draw outside the pixmap.