[sushi] mainwindow: don't allocate extra x/y padding if size < min_size



commit aee79ec7b878feee0537ee40021cf1dd4b554545
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri May 13 17:26:20 2011 -0400

    mainwindow: don't allocate extra x/y padding if size < min_size

 src/js/ui/mainWindow.js |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index 9d8957f..4f65175 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -192,12 +192,10 @@ MainWindow.prototype = {
         let textureSize = this._getTextureSize();
         let windowSize = textureSize;
 
-        if (textureSize[0] < Constants.VIEW_MIN &&
-            textureSize[1] < Constants.VIEW_MIN) {
+        if (textureSize[0] < (Constants.VIEW_MIN - 2 * Constants.VIEW_PADDING_X) &&
+            textureSize[1] < (Constants.VIEW_MIN - Constants.VIEW_PADDING_Y)) {
             windowSize = [ Constants.VIEW_MIN, Constants.VIEW_MIN ];
-        }
-
-        if (!this._isFullScreen) {
+        } else if (!this._isFullScreen) {
             windowSize = [ windowSize[0] + 2 * Constants.VIEW_PADDING_X,
                            windowSize[1] + Constants.VIEW_PADDING_Y ];
         }



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