1
Window / Re: Change viewport to keep aspect ratio of scene
« on: August 02, 2014, 01:19:22 am »
@Hapax: Well then I know why we miscommunicate as you see percentage in a range of 0..100(which is absolutely right) and I just called it percentage as it should not be larger than 100% = 1.0.
I can understand your misinterpretation of the doubled usage of the floatrects properties width/height on the one hand in pixels and on the one hand in ratios.
The code from the others works, but I found an other error(continue reading).
@mely: I just tested your example and it worked perfectly. I put it into my application and it was working. Then I changed the code from relying on window.getSize( ) on my variables windoww and windowh. Then it was not working and stretching wrong. Then I found a typo in my resize-event where I asign the new width and height to windoww but windowh is not affected. So I guess even my code should have worked without the typo (not tested).
Thank you for your patience and pointing me (unintentionally) to an error (I should have been aware of).
I can understand your misinterpretation of the doubled usage of the floatrects properties width/height on the one hand in pixels and on the one hand in ratios.
The code from the others works, but I found an other error(continue reading).
@mely: I just tested your example and it worked perfectly. I put it into my application and it was working. Then I changed the code from relying on window.getSize( ) on my variables windoww and windowh. Then it was not working and stretching wrong. Then I found a typo in my resize-event where I asign the new width and height to windoww but windowh is not affected. So I guess even my code should have worked without the typo (not tested).
Thank you for your patience and pointing me (unintentionally) to an error (I should have been aware of).