ecere/gui/Label: Tweak for label to only auto-size (OnResizing) for the dimension...
authorJerome St-Louis <jerome@ecere.com>
Wed, 1 Aug 2012 02:44:56 +0000 (22:44 -0400)
committerJerome St-Louis <jerome@ecere.com>
Wed, 1 Aug 2012 02:44:56 +0000 (22:44 -0400)
ecere/src/gui/controls/Label.ec

index f0726c2..8e8ac0b 100644 (file)
@@ -83,11 +83,15 @@ private:
          int width = 0, height = 0;
 
          display.FontExtent(fontObject, string, strlen(string), &width, &height);
-         if(labeledWindow && labeledWindow.text)
-            *w = Max(width, *w);
-         else
-            *w = Max(width, 80);
-         *h = Max(height, *h);
+         if(!*w)
+         {
+            if(labeledWindow && labeledWindow.text)
+               *w = Max(width, *w);
+            else
+               *w = Max(width, 80);
+         }
+         if(!*h)
+            *h = Max(height, *h);
       }
       return true;
    }