Revision 45516ed2
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/config/ConfigActivity.java | ||
---|---|---|
218 | 218 |
errDiag.show(getSupportFragmentManager(), null); |
219 | 219 |
} |
220 | 220 |
|
221 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
222 |
|
|
223 |
private Static4D getDefaultRotation(int numFaces) |
|
224 |
{ |
|
225 |
switch(numFaces) |
|
226 |
{ |
|
227 |
case 4: return ShapeTetrahedron.DEFAULT_ROT; |
|
228 |
case 6: return ShapeHexahedron.DEFAULT_ROT; |
|
229 |
case 8: return ShapeOctahedron.DEFAULT_ROT; |
|
230 |
case 12: return ShapeDodecahedron.DEFAULT_ROT; |
|
231 |
} |
|
232 |
|
|
233 |
return null; |
|
234 |
} |
|
235 |
|
|
236 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
237 |
|
|
238 |
void rotateObject(int numFaces) |
|
239 |
{ |
|
240 |
ConfigSurfaceView view = findViewById(R.id.configSurfaceView); |
|
241 |
ObjectControl control = view.getObjectControl(); |
|
242 |
Static4D rot = getDefaultRotation(numFaces); |
|
243 |
|
|
244 |
if( rot!=null ) control.rotateNow(rot); |
|
245 |
} |
|
246 |
|
|
247 | 221 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
248 | 222 |
|
249 | 223 |
private void changeIfDifferent(RubikObject object,ObjectControl control) |
Also available in: Unified diff
Fix setDefaultRotation() when changing an object; do it at exactly the right time when the 'old' object has already disappeared, but the new hasn't been attached to the Nodee yet.