Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/OficinaActivity.py
diff options
context:
space:
mode:
Diffstat (limited to 'OficinaActivity.py')
-rw-r--r--OficinaActivity.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/OficinaActivity.py b/OficinaActivity.py
index 1745d0a..64dace4 100644
--- a/OficinaActivity.py
+++ b/OficinaActivity.py
@@ -201,13 +201,15 @@ class OficinaActivity(activity.Activity):
canvas_width = self.canvas.allocation.width
canvas_height = self.canvas.allocation.height
area_width, area_height = self.area.get_size_request()
- x = (canvas_width - area_width) / 2
- y = (canvas_height - area_height) / 2
+
+ # Avoid 'x' and 'y' to be outside the screen
+ x = max(0, (canvas_width - area_width) / 2)
+ y = max(0, (canvas_height - area_height) / 2)
return x, y
def center_area(self):
x, y = self._get_area_displacement()
- self.fixed.move(self.area, x, 0)
+ self.fixed.move(self.area, x, y)
def move_textview(self, dx, dy):
x, y = self._get_area_displacement()