About Store Forum Documentation Contact



Post Reply 
Strange Problem with Window Rect
Author Message
fatcoder Offline
Member

Post: #1
Strange Problem with Window Rect
I have come across a strange problem that may be a bug. I have reproduced the problem using the Bars Gui tutorial. In the tutorial code, I have changed the line where the window is created like this.

Code:
Gui   +=window  .create(Rect_LD(-D.w(), -D.h(), 0.046f, 0.6f), "Window with bars");

Here is the result when I run the tutorial, with the above change. The window is placed and sized correctly.

   

However if I change the width of the window to make it 0.001 smaller, I get a problem. Here is the changed code. Notice the window should now be slightly narrower.

Code:
Gui   +=window  .create(Rect_LD(-D.w(), -D.h(), 0.045f, 0.6f), "Window with bars");

Here is the result. The window is no longer placed or positioned correctly. When inspecting the window.rect, it does not match the above Rect_LD settings.

   

This "bug" is making it very difficult to create narrow windows, like for tool bars for example.
04-19-2012 09:22 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Strange Problem with Window Rect
Nice catch, I'm working on this.
There is a small bug but remember if you want smaller windows you need to override Window::sizeLimit as well (if you set a small value there, then you can make it work without waiting for my fix)
04-22-2012 05:44 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #3
RE: Strange Problem with Window Rect
Cheers. I found an ugly "hack" to get around the problem for now. Looking forward to your fix though so I can remove the ugly code. lol
04-22-2012 08:28 AM
Find all posts by this user Quote this message in a reply
Post Reply