commit 2d88fcc3759751fa4cddd5b308102780516d7e86
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Thu May 12 22:14:34 2022 +0200

    Correctly compute bandaged icon's projection angle.

diff --git a/src/main/java/org/distorted/bandaged/BandagedCreatorRenderer.java b/src/main/java/org/distorted/bandaged/BandagedCreatorRenderer.java
index abb678fa..1bbfee4a 100644
--- a/src/main/java/org/distorted/bandaged/BandagedCreatorRenderer.java
+++ b/src/main/java/org/distorted/bandaged/BandagedCreatorRenderer.java
@@ -485,6 +485,25 @@ public class BandagedCreatorRenderer implements GLSurfaceView.Renderer, Distorte
        }
      }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   private int computeProjectionAngle()
+     {
+     float quot1 = mObjSize[2]/ (float)mObjSize[0];
+     float quot2 = mObjSize[2]/ (float)mObjSize[1];
+     float quot3 = mObjSize[0]/ (float)mObjSize[2];
+     float quot4 = mObjSize[0]/ (float)mObjSize[1];
+
+     float quot5 = Math.max(quot1,quot2);
+     float quot6 = Math.max(quot3,quot4);
+     float quot7 = Math.max(quot5,quot6);
+
+          if( quot7<=1.0f ) return 120;
+     else if( quot7<=1.5f ) return 90;
+     else if( quot7<=2.0f ) return 60;
+     else                   return 30;
+     }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
    private void setupIconCreation(Activity act)
@@ -500,29 +519,13 @@ public class BandagedCreatorRenderer implements GLSurfaceView.Renderer, Distorte
      DistortedEffects effects = obj.getObjectEffects();
      DistortedNode node = obj.getNode();
 
-     float quot1 = mObjSize[2]/ (float)mObjSize[0];
-     float quot2 = mObjSize[2]/ (float)mObjSize[1];
-     float quot3 = mObjSize[0]/ (float)mObjSize[2];
-     float quot4 = mObjSize[0]/ (float)mObjSize[1];
-
-     float quot5 = Math.max(quot1,quot2);
-     float quot6 = Math.max(quot3,quot4);
-     float quot7 = Math.max(quot5,quot6);
-
-     int angle;
-
-          if( quot7<=1.0f ) angle=120;
-     else if( quot7<=1.5f ) angle= 90;
-     else if( quot7<=2.0f ) angle= 60;
-     else                   angle= 30;
-
      if( mFramebuffer==null )
        {
        mFramebuffer = new DistortedFramebuffer(FBO_WIDTH,FBO_HEIGHT,1, InternalOutputSurface.DEPTH_NO_STENCIL);
        mFramebuffer.glClearColor(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS, 1.0f);
-       mFramebuffer.setProjection(angle,0.1f);
        }
 
+     mFramebuffer.setProjection( computeProjectionAngle() ,0.1f);
      mFramebuffer.detachAll();
      mFramebuffer.attach(node);
 
