diff --git a/src/gui/editing.cpp b/src/gui/editing.cpp index 3f6d4b1db..b9e035118 100644 --- a/src/gui/editing.cpp +++ b/src/gui/editing.cpp @@ -245,14 +245,22 @@ void FurnaceGUI::doPullDelete() { updateScroll(cursor.y); } - int iCoarse=selStart.xCoarse; - int iFine=selStart.xFine; - for (; iCoarse<=selEnd.xCoarse; iCoarse++) { + SelectionPoint sStart=selStart; + SelectionPoint sEnd=selEnd; + + if (selStart.xCoarse==selEnd.xCoarse && selStart.xFine==selEnd.xFine && selStart.y==selEnd.y && settings.pullDeleteRow) { + sStart.xFine=0; + sEnd.xFine=2+e->curPat[sEnd.xCoarse].effectCols*2; + } + + int iCoarse=sStart.xCoarse; + int iFine=sStart.xFine; + for (; iCoarse<=sEnd.xCoarse; iCoarse++) { if (!e->curSubSong->chanShow[iCoarse]) continue; DivPattern* pat=e->curPat[iCoarse].getPattern(e->curOrders->ord[iCoarse][curOrder],true); - for (; iFine<3+e->curPat[iCoarse].effectCols*2 && (iCoarsecurPat[iCoarse].effectCols*2 && (iCoarsecurSubSong->patLen; j++) { + for (int j=sStart.y; jcurSubSong->patLen; j++) { if (jcurSubSong->patLen-1) { if (iFine==0) { pat->data[j][iFine]=pat->data[j+1][iFine]; @@ -280,7 +288,7 @@ void FurnaceGUI::doInsert() { SelectionPoint sStart=selStart; SelectionPoint sEnd=selEnd; - if (selStart.xCoarse==selEnd.xCoarse && selStart.xFine==selEnd.xFine && selStart.y==selEnd.y) { + if (selStart.xCoarse==selEnd.xCoarse && selStart.xFine==selEnd.xFine && selStart.y==selEnd.y && settings.insertBehavior) { sStart.xFine=0; sEnd.xFine=2+e->curPat[sEnd.xCoarse].effectCols*2; } diff --git a/src/gui/gui.h b/src/gui/gui.h index 48169b83f..f5b581091 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1497,6 +1497,7 @@ class FurnaceGUI { int newPatternFormat; int renderClearPos; int insertBehavior; + int pullDeleteRow; unsigned int maxUndoSteps; String mainFontPath; String patFontPath; @@ -1647,6 +1648,7 @@ class FurnaceGUI { newPatternFormat(1), renderClearPos(0), insertBehavior(1), + pullDeleteRow(1), maxUndoSteps(100), mainFontPath(""), patFontPath(""), diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index a442b4306..9648de128 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -548,6 +548,11 @@ void FurnaceGUI::drawSettings() { settings.insertBehavior=insertBehaviorB; } + bool pullDeleteRowB=settings.pullDeleteRow; + if (ImGui::Checkbox("Pull delete affects entire channel row",&pullDeleteRowB)) { + settings.pullDeleteRow=pullDeleteRowB; + } + bool absorbInsInputB=settings.absorbInsInput; if (ImGui::Checkbox("Change current instrument when changing instrument column (absorb)",&absorbInsInputB)) { settings.absorbInsInput=absorbInsInputB; @@ -2743,6 +2748,7 @@ void FurnaceGUI::syncSettings() { settings.renderBackend=e->getConfString("renderBackend","SDL"); settings.renderClearPos=e->getConfInt("renderClearPos",0); settings.insertBehavior=e->getConfInt("insertBehavior",1); + settings.pullDeleteRow=e->getConfInt("pullDeleteRow",1); clampSetting(settings.mainFontSize,2,96); clampSetting(settings.patFontSize,2,96); @@ -2867,6 +2873,7 @@ void FurnaceGUI::syncSettings() { clampSetting(settings.newPatternFormat,0,1); clampSetting(settings.renderClearPos,0,1); clampSetting(settings.insertBehavior,0,1); + clampSetting(settings.pullDeleteRow,0,1); if (settings.exportLoops<0.0) settings.exportLoops=0.0; if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0; @@ -3087,6 +3094,7 @@ void FurnaceGUI::commitSettings() { e->setConf("renderBackend",settings.renderBackend); e->setConf("renderClearPos",settings.renderClearPos); e->setConf("insertBehavior",settings.insertBehavior); + e->setConf("pullDeleteRow",settings.pullDeleteRow); // colors for (int i=0; i