[ocrfeeder] Fix boxes' creation (gb#24793)



commit 921b91572fbd0154ed7c93372d99bd813a4fe2d3
Author: Joaquim Rocha <jrocha igalia com>
Date:   Fri Jul 23 11:48:34 2010 +0200

    Fix boxes' creation (gb#24793)
    
    There were exceptions being raised when creating a box dragging
    the mouse over the limits of the image.

 studio/customWidgets.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/studio/customWidgets.py b/studio/customWidgets.py
index ce2c9cb..ee6b176 100644
--- a/studio/customWidgets.py
+++ b/studio/customWidgets.py
@@ -231,8 +231,12 @@ class SelectableBoxesArea(goocanvas.Canvas):
             end_y = event.y
             if event.x > self.image.props.width:
                 end_x = self.image.props.width
+            elif event.x < 0:
+                end_x = 0
             if event.y > self.image.props.height:
                 end_y = self.image.props.height
+            elif event.y < 0:
+                end_y = 0
             end_point = (end_x, end_y)
             x, y, width, height = self.__getRectangleFromPoints(start_point, end_point)
             self.currently_created_area.props.x = x



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]