public static void MakeRect1CenterInsideRect2(MRect mrect, MRect mrect1)
 {
     int i = (mrect.left + mrect.right) / 2;
     int j = (mrect.top + mrect.bottom) / 2;
     int k = mrect.right - mrect.left;
     int l = mrect.bottom - mrect.top;
     if (i <= mrect1.left)
     {
         mrect.left = 1 + (mrect1.left - k / 2);
         mrect.right = k + mrect.left;
     }
     if (i >= mrect1.right)
     {
         mrect.left = -1 + (mrect1.right - k / 2);
         mrect.right = k + mrect.left;
     }
     if (j <= mrect1.top)
     {
         mrect.top = 1 + (mrect1.top - l / 2);
         mrect.bottom = l + mrect.top;
     }
     if (j >= mrect1.bottom)
     {
         mrect.top = -1 + (mrect1.bottom - l / 2);
         mrect.bottom = l + mrect.top;
     }
 }
 public static int back2BestFitMode(WorkShop workshop)
 {
     int i;
     if (workshop == null)
     {
         i = 2;
     } else
     {
         MRect mrect = new MRect();
         mrect.set(0, 0, workshop.getDisplayW() - 0, workshop.getDisplayH());
         MRect mrect1 = new MRect();
         powermobia.photoeditor.EditorEngine.State state = new powermobia.photoeditor.EditorEngine.State();
         EditorEngineWrapper editorenginewrapper = workshop.getEditorEngineWrapper();
         i = editorenginewrapper.getState(state);
         getFitInParamEx(mrect1, state.iImgWidth, state.iImgHeight, mrect.right - mrect.left, mrect.bottom - mrect.top, false);
         mrect1.top = 0 + mrect1.top;
         mrect1.bottom = 0 + mrect1.bottom;
         if (mrect1.width() > 0 && mrect1.height() > 0)
         {
             if (workshop.getUIManagerConsole() != null)
             {
                 workshop.getUIManagerConsole().onChange(2, null, null);
             }
             i = editorenginewrapper.setImgBorderDes(mrect1);
             if (workshop.getUIManagerConsole() != null)
             {
                 workshop.getUIManagerConsole().onChange(3, null, null);
                 return i;
             }
         }
     }
     return i;
 }
 public static int back2BestFitModeForEdit(WorkShop workshop)
 {
     int l;
     if (workshop == null)
     {
         l = 2;
     } else
     {
         int i = workshop.getResources().getInteger(0x7f0a001a);
         int j = workshop.getResources().getInteger(0x7f0a001b);
         int k = workshop.getResources().getInteger(0x7f0a001c);
         MRect mrect = new MRect();
         mrect.set(k, i, workshop.getDisplayW() - k, workshop.getDisplayH() - i - j);
         MRect mrect1 = new MRect();
         powermobia.photoeditor.EditorEngine.State state = new powermobia.photoeditor.EditorEngine.State();
         EditorEngineWrapper editorenginewrapper = workshop.getEditorEngineWrapper();
         l = editorenginewrapper.getState(state);
         getFitInParamEx(mrect1, state.iImgWidth, state.iImgHeight, mrect.right - mrect.left, mrect.bottom - mrect.top, false);
         mrect1.top = j + mrect1.top;
         mrect1.bottom = j + mrect1.bottom;
         mrect1.left = k + mrect1.left;
         mrect1.right = k + mrect1.right;
         if (mrect1.width() > 0 && mrect1.height() > 0)
         {
             if (workshop.getUIManagerConsole() != null)
             {
                 workshop.getUIManagerConsole().onChange(2, null, null);
             }
             l = editorenginewrapper.setImgBorderDes(mrect1);
             if (workshop.getUIManagerConsole() != null)
             {
                 workshop.getUIManagerConsole().onChange(3, null, null);
                 return l;
             }
         }
     }
     return l;
 }