Project

General

Profile

« Previous | Next » 

Revision e4f656d1

Added by Leszek Koltunski over 2 years ago

Simplifications

View differences:

src/main/java/org/distorted/patterns/RubikPattern.java
335 335
          int axis      = moves[curMove-1][0];
336 336
		      int rowBitmap = moves[curMove-1][1];
337 337
		      int bareAngle = moves[curMove-1][2];
338
		      int basicAngle= control.getObject().getBasicAngle()[axis];
339
          int angle     = bareAngle*(360/basicAngle);
340
          int duration  = Math.abs(angle)*MILLIS_PER_DEGREE;
341 338

  
342
          if( angle!=0 )
339
          if( bareAngle!=0 )
343 340
            {
344 341
            mCanRotate = false;
345
            control.addRotation(this, axis, rowBitmap, angle, duration);
342
            control.addRotation(this, axis, rowBitmap, bareAngle, MILLIS_PER_DEGREE);
346 343
            }
347 344
          else
348 345
            {
......
376 373
          int axis      = moves[curMove][0];
377 374
		      int rowBitmap = moves[curMove][1];
378 375
		      int bareAngle = moves[curMove][2];
379
		      int basicAngle= control.getObject().getBasicAngle()[axis];
380
          int angle     = bareAngle*(360/basicAngle);
381
          int duration  = Math.abs(angle)*MILLIS_PER_DEGREE;
382 376

  
383
          if( angle!=0 )
377
          if( bareAngle!=0 )
384 378
            {
385 379
            mCanRotate = false;
386
            control.addRotation(this, axis, rowBitmap, -angle, duration);
380
            control.addRotation(this, axis, rowBitmap, -bareAngle, MILLIS_PER_DEGREE);
387 381
            }
388 382
          else
389 383
            {

Also available in: Unified diff