Revision b88ef2f2
Added by Leszek Koltunski over 1 year ago
src/main/java/org/distorted/objectlib/main/ObjectControl.java | ||
---|---|---|
479 | 479 |
TouchControl tmp = mTouchControlBackup; |
480 | 480 |
mTouchControlBackup = mTouchControl; |
481 | 481 |
mTouchControl = tmp; |
482 |
|
|
483 |
if( mTouchControl instanceof TouchControlShapeChanging ) |
|
484 |
{ |
|
485 |
((TouchControlShapeChanging)mTouchControl).prepareAgain(); |
|
486 |
} |
|
482 | 487 |
} |
483 | 488 |
else |
484 | 489 |
{ |
... | ... | |
488 | 493 |
{ |
489 | 494 |
mTouchControlBackup = mTouchControl; |
490 | 495 |
mTouchControl = new TouchControlShapeChanging(object); |
491 |
float ratio = object.getObjectRatio(); |
|
492 |
mTouchControl.setObjectRatio(ratio); |
|
493 | 496 |
} |
494 | 497 |
} |
495 | 498 |
} |
src/main/java/org/distorted/objectlib/touchcontrol/TouchControlShapeChanging.java | ||
---|---|---|
216 | 216 |
|
217 | 217 |
private void prepare() |
218 | 218 |
{ |
219 |
float ratio = mObject.getObjectRatio(); |
|
220 |
setObjectRatio(ratio); |
|
219 | 221 |
int[] numLayers = mObject.getNumLayers(); |
220 | 222 |
float[][] positions = mObject.getCubitPositions(numLayers); |
221 | 223 |
float size = mObject.getSize(); |
... | ... | |
588 | 590 |
} |
589 | 591 |
} |
590 | 592 |
|
593 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
594 |
|
|
595 |
public void prepareAgain() |
|
596 |
{ |
|
597 |
mPreparationDone = false; |
|
598 |
} |
|
599 |
|
|
591 | 600 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
592 | 601 |
|
593 | 602 |
public int getTouchedCubitFace() |
Also available in: Unified diff
Always prepare() TouchControlShapeChanging when we enter the Solver. Otherwise it could sometimes be prepared with some different object and would crash in touching the screen.