Project

General

Profile

« Previous | Next » 

Revision 2e755580

Added by Leszek Koltunski almost 8 years ago

Correct a bug in Effects3D.

View differences:

src/main/java/org/distorted/examples/effects3d/Effects3DActivity.java
62 62

  
63 63
  private int mNumCols = 10;
64 64
  private int mNumRows = 10;
65
  private boolean mGridInitialized;
65 66
  private NumberPicker mColsPicker, mRowsPicker;
66 67
  private boolean[] mShape;
67 68
  private DistortedTexture mTexture;
......
124 125
         });
125 126

  
126 127
    mObjectType = 0;
128
    mGridInitialized = false;
127 129

  
128 130
    Spinner typeSpinner  = (Spinner)findViewById(R.id.objectpicker_spinnerType);
129 131
    typeSpinner.setOnItemSelectedListener(this);
......
174 176

  
175 177
  private void setGrid()
176 178
    {
179
    mGridInitialized = true;
180

  
177 181
    mNumCols = mColsPicker.getValue();
178 182
    mNumRows = mRowsPicker.getValue();
179 183

  
......
644 648
    mColsPicker.setValue(mNumCols);
645 649
    mRowsPicker.setValue(mNumRows);
646 650

  
647
    if( hasFocus ) setGrid();
651
    if( !mGridInitialized ) setGrid();
648 652
    }
649 653

  
650 654
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff