OSDN Git Service

Two subsequent dragging of different atoms were causing undo failure. Fixed.
authortoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Tue, 30 Oct 2012 00:11:43 +0000 (00:11 +0000)
committertoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Tue, 30 Oct 2012 00:11:43 +0000 (00:11 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@313 a2be9bc6-48de-4e38-9406-05402d4bc13c

MolLib/MainView.c

index ee27660..8c00a8d 100755 (executable)
@@ -2407,10 +2407,12 @@ MainView_mouseUp(MainView *mview, const float *mousePos, int flags, int clickCou
                case kMainViewDraggingSelectedAtoms: {
                        Vector offset;
                        if (mview->isDragging) {
+                               IntGroup *dupSelection = IntGroupNewFromIntGroup(mview->mol->selection);
                                calcDragOffset(mview, &offset);
                        /*      if (mview->mol->is_xtal_coord)
                                        TransformVec(&offset, mview->mol->cell->rtr, &offset); */
-                               MolActionCreateAndPerform(mview->mol, gMolActionTranslateAtoms, &offset, mview->mol->selection);
+                               MolActionCreateAndPerform(mview->mol, gMolActionTranslateAtoms, &offset, dupSelection);
+                               IntGroupRelease(dupSelection);
                /*      } else if (clickCount == 2) {
                                buf[0] = 0;
                                if (MyAppCallback_getTextWithPrompt("Enter formula (e.g. CH2OCH3)", buf, sizeof buf) == 0)