Project

General

Profile

« Previous | Next » 

Revision 740fade2

Added by Leszek Koltunski 23 days ago

Fix the association between a RubikObject and its solvers and patterns.

Before, if we rearranged the objects order in the main screen, this would break down.

View differences:

src/main/java/org/distorted/dialogs/RubikDialogPattern.java
21 21
import org.distorted.objectlib.main.ObjectControl;
22 22
import org.distorted.objectlib.patterns.RubikPattern;
23 23
import org.distorted.objectlib.patterns.RubikPatternList;
24
import org.distorted.objects.RubikObject;
25
import org.distorted.objects.RubikObjectList;
24 26
import org.distorted.patternui.PatternActivity;
25 27
import org.distorted.patternui.ScreenList;
26 28
import org.distorted.patternui.ScreenPattern;
......
73 75
      return;
74 76
      }
75 77

  
76
    mPatternOrdinal = RubikPatternList.getOrdinal(objectOrdinal);
78
    RubikObject object = RubikObjectList.getObject(objectOrdinal);
79
    int objectIndex = object==null ? -1 : object.getIndex();
80

  
81
    mPatternOrdinal = RubikPatternList.getOrdinal(objectIndex);
77 82

  
78 83
    if( mPatternOrdinal<0 )
79 84
      {

Also available in: Unified diff