[the-board] [ui] Ensure MainWindow has even dimensions



commit 393d8c54a2f2a9b13088af777c74c3d4d33b89a6
Author: Lucas Rocha <lucasr gnome org>
Date:   Sun Jan 23 21:56:49 2011 +0000

    [ui] Ensure MainWindow has even dimensions
    
    In order to avoid sub-pixel allocations in UI elements centered in the
    window.

 src/js/ui/mainWindow.js |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index 40a414e..8a73377 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -461,10 +461,17 @@ MainWindow.prototype = {
     _updateWindowSize : function() {
         let screen = Gdk.Screen.get_default();
 
-        let newWidth = Math.round(screen.get_width() * 0.9);
+        let newWidth = Math.round(screen.get_width() * 0.84);
+        if (newWidth % 2) {
+            newWidth -= 1;
+        }
+
         let newHeight = Math.round(screen.get_height() * 0.9);
+        if (newHeight % 2) {
+            newWidth -= 1;
+        }
 
-        this._gtkWindow.defaultWidth = Math.min(1115, newWidth);
+        this._gtkWindow.defaultWidth = Math.min(1114, newWidth);
         this._gtkWindow.defaultHeight = Math.min(720, newHeight);
     },
 



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