Revision 7a733a8c
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/main/RubikPreRender.java | ||
---|---|---|
698 | 698 |
{ |
699 | 699 |
if( effectID == mEffectID[i] ) |
700 | 700 |
{ |
701 |
unblockEverything(); |
|
701 |
if( i!=BaseEffect.Type.WIN.ordinal() ) |
|
702 |
{ |
|
703 |
unblockEverything(); |
|
704 |
} |
|
702 | 705 |
|
703 | 706 |
if( i==BaseEffect.Type.SCRAMBLE.ordinal() ) |
704 | 707 |
{ |
src/main/java/org/distorted/main/RubikSurfaceView.java | ||
---|---|---|
372 | 372 |
float distNow = (float)Math.sqrt( (x-x2)*(x-x2) + (y-y2)*(y-y2) ); |
373 | 373 |
float distQuot = mInitDistance<0 ? 1.0f : distNow/ mInitDistance; |
374 | 374 |
mInitDistance = distNow; |
375 |
/* |
|
376 |
if( angleDiff< 0.00001f && angleDiff>-0.00001f) |
|
377 |
android.util.Log.e("D", " distQuot="+distQuot); |
|
378 |
else |
|
379 |
android.util.Log.e("D", "angelDiff "+angleDiff+" distQuot="+distQuot); |
|
380 |
*/ |
|
381 | 375 |
TwistyObject object = mPreRender.getObject(); |
382 | 376 |
if( object!=null ) object.setObjectRatio(distQuot); |
383 | 377 |
} |
Also available in: Unified diff
Important bugfix: no we cannot unblock touch when WIN effect finishes, because
1) starting the WIN effect does not block touch in the first place
2) it can happen that this unblocking happens when we have started finishing the rotation but haven't removed it yet
If 2) happens and the user is swiping his finger, he is able to add a new rotation while the previous one hasn't been removed yet - with disastrous consequences.