From 45078ac670390cec1aa41a9d0bfb1472f764c72d Mon Sep 17 00:00:00 2001
From: BIASUTTI Pierre
Date: Thu, 30 Jan 2020 12:43:14 +0100
Subject: [PATCH] Added annotation width and height in toolbar while drawing.
---
libs/canvas.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libs/canvas.py b/libs/canvas.py
index 211c390b..a634e5c5 100644
--- a/libs/canvas.py
+++ b/libs/canvas.py
@@ -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.