JMEDesktop Resize Change

I wanted to be able to resize a JMEDesktop so one absolute layout could support any resolution with simple scaling. However I noticed an issue with the calculation of the mouse coords once the desktop was scaled. I have a fix and was wondering if it could be committed.



Index: JMEDesktop.java
===================================================================
--- JMEDesktop.java   (revision 935)
+++ JMEDesktop.java   (working copy)
@@ -967,8 +967,8 @@
             lastYin = y;
             if ( getRenderQueueMode() == Renderer.QUEUE_ORTHO ) {
                 //TODO: occlusion by other quads (JMEFrames)
-                x = (int) ( x - getWorldTranslation().x + desktopWidth / 2 );
-                y = (int) ( desktopHeight / 2 - ( y - getWorldTranslation().y ) );
+                x = (int) (x/(getWorldTranslation().x * 2) * desktopWidth);
+                y = (int) (desktopHeight - (y/(getWorldTranslation().y * 2) * desktopHeight));
             }
             else {
                 store.set( x, y );



If anyone is interested what this enables is setting up one layout (I do it at 1920x1080) and then for every resolution I simply interpolate the scale between the original (1920x1080) res and the new res. Then I just set the scale on the JMEDesktop and the interface stretches to meet the new size. Very simple method if you don't care if the interface stretches.