[kupfer] ui: Correct position calculation when centering window



commit f5a535c9f743607a97a40c90a9509cf9480bf8ee
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Thu Nov 4 23:07:30 2010 +0100

    ui: Correct position calculation when centering window

 kupfer/ui/browser.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/kupfer/ui/browser.py b/kupfer/ui/browser.py
index 44ce4e6..ae30d9b 100644
--- a/kupfer/ui/browser.py
+++ b/kupfer/ui/browser.py
@@ -1557,8 +1557,8 @@ class WindowController (pretty.OutputMixin):
 		monitor_nr = screen.get_monitor_at_point(x, y)
 		geo = screen.get_monitor_geometry(monitor_nr)
 		wid, hei = self.window.get_size()
-		midx = (geo.x + geo.width) / 2.0 - wid/2.0
-		midy = (geo.y + geo.height) / 2.0 - hei/2.0
+		midx = geo.x + geo.width / 2.0 - wid / 2.0
+		midy = geo.y + geo.height / 2.0 - hei / 2.0
 		self.window.move(midx, midy)
 
 	def _should_recenter_window(self):



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