Label.AutoSize = true "AFTER" positioning is broken

Started by tueda, 31 October 2013, 03:33:38

tueda

If I set Label.AutoSize = true after positioning, calculated size value is invalid and text is chopped.
See attached image.
Is this the behavior you intended?
I used  TGUI.Net (latest development snapshot) downloading yesterday.

 
      static public void LoadWidgets (Gui gui) {
           // Create the background image
           var pic = gui.Add (new Picture ("media/Vanity.jpg"));
           pic.Size = new Vector2f (800, 600);

           for (var i = 0; i < 4; i++) {
               var label = gui.Add (new Label ("widgets/Black.conf"));
               label.Text = "Hello, world";
               label.Position = new Vector2f (50*i, 50*i);
               label.AutoSize = true;
               label.TextColor = Color.Red;
               label.BackgroundColor = Color.Black;
           }
        }


texus

It seems like this has already been fixed in the c++ version.

It must have been a change that I missed when changing the .Net port.
I'll try to fix this as soon as possible.

Edit: Fixed.