[gnome-shell] Integer align workspace and pane positioning



commit 2c914374e0ec88b199ed9472fc7e54ab87a121ea
Author: Colin Walters <walters verbum org>
Date:   Fri Nov 13 18:51:07 2009 -0500

    Integer align workspace and pane positioning
    
    We had previously been leaving the scaled workspace at a non-integral
    position which didn't look obviously ugly, but now that we're
    constraining the popup pane to the workspace size, we really need
    to ensure that we're using integral positions here.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=601854

 js/ui/overview.js |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/overview.js b/js/ui/overview.js
index e491192..e217bfe 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -148,11 +148,11 @@ Overview.prototype = {
         // We divide the screen into an imaginary grid which helps us determine the layout of
         // different visual components.
         if (wideScreen) {
-            displayGridColumnWidth = primary.width / COLUMNS_WIDE_SCREEN;
-            displayGridRowHeight = primary.height / ROWS_WIDE_SCREEN;
+            displayGridColumnWidth = Math.floor(primary.width / COLUMNS_WIDE_SCREEN);
+            displayGridRowHeight = Math.floor(primary.height / ROWS_WIDE_SCREEN);
         } else {
-            displayGridColumnWidth = primary.width / COLUMNS_REGULAR_SCREEN;
-            displayGridRowHeight = primary.height / ROWS_REGULAR_SCREEN;
+            displayGridColumnWidth = Math.floor(primary.width / COLUMNS_REGULAR_SCREEN);
+            displayGridRowHeight = Math.floor(primary.height / ROWS_REGULAR_SCREEN);
         }
     },
 
@@ -174,11 +174,11 @@ Overview.prototype = {
                                   - WORKSPACE_GRID_PADDING * 2;
         // We scale the vertical padding by (primary.height / primary.width)
         // so that the workspace preserves its aspect ratio.
-        this._workspacesHeight = displayGridRowHeight * workspaceRowsUsed
-                                   - WORKSPACE_GRID_PADDING * (primary.height / primary.width) * 2;
+        this._workspacesHeight = Math.floor(displayGridRowHeight * workspaceRowsUsed
+                                   - WORKSPACE_GRID_PADDING * (primary.height / primary.width) * 2);
 
         this._workspacesX = displayGridColumnWidth + WORKSPACE_GRID_PADDING;
-        this._workspacesY = displayGridRowHeight + WORKSPACE_GRID_PADDING * (primary.height / primary.width);
+        this._workspacesY = Math.floor(displayGridRowHeight + WORKSPACE_GRID_PADDING * (primary.height / primary.width));
 
         this._dash.actor.set_position(0, contentY);
         this._dash.actor.set_size(displayGridColumnWidth, contentHeight);



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