Viewport in v0.7dev

Started by Dnake, 03 October 2014, 09:00:57

Dnake

I noticed that the new view system doesn't take in account the viewport. Or if it does, I have issues to correctly set the view of TGUI.
In the exemple, I have a resizable window, and a function that set a viewport every time the window is resized. The goal is to keep a certain ratio in the view of the window. That trick works fine with native SFML stuff and TGUI 0.6, but since the last version I'm not longer able to do this.

I assume that the concerned code is between line 101 and 106 of Gui.cpp.

texus

If you want to get it to work quickly, you should make the following change in the tgui code: https://github.com/texus/TGUI/commit/350a3b2fe6cfd71dc57230f2588e8ff021a28f9d

I reverted the change right after I pushed it because I realized that this will only work when the sfml and tgui views are identical. But if this is the case then you can make the change in your local tgui code while I try to find a better solution.

Dnake


texus

It should be fixed now.

Apparently I was already storing the view and its viewport, I just didn't set it when drawing.