commit 3c28857f28b632e5a606162a79709a2baa9f0f43
Author: Leszek Koltunski <leszek@distorted.org>
Date:   Sun Aug 7 23:50:55 2016 +0100

    Fix the 1x1 case! Before it used to be impossible to create a DistortedBitmap just with 2 triangles!

diff --git a/src/main/java/org/distorted/examples/monalisa/MonaLisaRenderer.java b/src/main/java/org/distorted/examples/monalisa/MonaLisaRenderer.java
index 1627f38..2ec1134 100644
--- a/src/main/java/org/distorted/examples/monalisa/MonaLisaRenderer.java
+++ b/src/main/java/org/distorted/examples/monalisa/MonaLisaRenderer.java
@@ -45,32 +45,12 @@ class MonaLisaRenderer implements GLSurfaceView.Renderer
 {
     private GLSurfaceView mView;
     private DistortedBitmap monaLisa;
-    private Static2D pLeft, pRight;
-    private Static4D rLeft, rRight;
-    private Dynamic3D dLeft, dRight;
 
-    private int bmpHeight, bmpWidth;
-    
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
     public MonaLisaRenderer(GLSurfaceView v) 
       {
       mView = v;
-      
-      pLeft = new Static2D( 90, 258);
-      pRight= new Static2D(176, 255);
-      
-      rLeft = new Static4D(-10,-10,25,25);
-      rRight= new Static4D( 10, -5,25,25);
-
-      dLeft = new Dynamic3D(1000,0.0f);
-      dRight= new Dynamic3D(1000,0.0f);
-
-      dLeft.add( new Static3D(  0,  0,0) );
-      dLeft.add( new Static3D(-20,-20,0) );
-
-      dRight.add( new Static3D(  0,  0,0) );
-      dRight.add( new Static3D( 20,-10,0) );
       }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -88,24 +68,8 @@ class MonaLisaRenderer implements GLSurfaceView.Renderer
     public void onSurfaceChanged(GL10 glUnused, int width, int height) 
       { 
       monaLisa.abortEffects(EffectTypes.MATRIX);
-         
-      if( bmpHeight/bmpWidth > height/width )
-        {
-        int w = (height*bmpWidth)/bmpHeight;
-        float factor = (float)height/bmpHeight;
+      monaLisa.move( new Static3D((width-200)/2, 10, 0) );
 
-        monaLisa.move( new Static3D((width-w)/2,0,0) );
-        monaLisa.scale(factor);
-        }
-      else
-        {
-        int h = (width*bmpHeight)/bmpWidth;
-        float factor = (float)width/bmpWidth;
-
-        monaLisa.move( new Static3D(0,(height-h)/2,0) );
-        monaLisa.scale(factor);
-        }
-      
       Distorted.onSurfaceChanged(width, height); 
       }
 
@@ -128,13 +92,9 @@ class MonaLisaRenderer implements GLSurfaceView.Renderer
           } 
         catch(IOException e) { }
         }  
-      
-      bmpHeight = bitmap.getHeight();
-      bmpWidth  = bitmap.getWidth();
-      
-      monaLisa = new DistortedBitmap(bitmap, 9);
-      monaLisa.distort( dLeft, pLeft , rLeft );
-      monaLisa.distort(dRight, pRight, rRight);
+
+      monaLisa = new DistortedBitmap(200,200,1);
+      monaLisa.setBitmap(bitmap);
 
       try
         {
