mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-16 01:35:07 +00:00
GUI: implement flip
This commit is contained in:
parent
bd705d837d
commit
cd42a8b9f3
1 changed files with 25 additions and 0 deletions
|
@ -3330,6 +3330,31 @@ void FurnaceGUI::doFlip() {
|
||||||
finishSelection();
|
finishSelection();
|
||||||
prepareUndo(GUI_UNDO_PATTERN_FLIP);
|
prepareUndo(GUI_UNDO_PATTERN_FLIP);
|
||||||
|
|
||||||
|
DivPattern patBuffer;
|
||||||
|
int iCoarse=selStart.xCoarse;
|
||||||
|
int iFine=selStart.xFine;
|
||||||
|
int ord=e->getOrder();
|
||||||
|
for (; iCoarse<=selEnd.xCoarse; iCoarse++) {
|
||||||
|
if (!e->song.chanShow[iCoarse]) continue;
|
||||||
|
DivPattern* pat=e->song.pat[iCoarse].getPattern(e->song.orders.ord[iCoarse][ord],true);
|
||||||
|
for (; iFine<3+e->song.pat[iCoarse].effectRows*2 && (iCoarse<selEnd.xCoarse || iFine<=selEnd.xFine); iFine++) {
|
||||||
|
maskOut(iFine);
|
||||||
|
for (int j=selStart.y; j<=selEnd.y; j++) {
|
||||||
|
if (iFine==0) {
|
||||||
|
patBuffer.data[j][0]=pat->data[j][0];
|
||||||
|
}
|
||||||
|
patBuffer.data[j][iFine+1]=pat->data[j][iFine+1];
|
||||||
|
}
|
||||||
|
for (int j=selStart.y; j<=selEnd.y; j++) {
|
||||||
|
if (iFine==0) {
|
||||||
|
pat->data[j][0]=patBuffer.data[selEnd.y-j+selStart.y][0];
|
||||||
|
}
|
||||||
|
pat->data[j][iFine+1]=patBuffer.data[selEnd.y-j+selStart.y][iFine+1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
iFine=0;
|
||||||
|
}
|
||||||
|
|
||||||
makeUndo(GUI_UNDO_PATTERN_FLIP);
|
makeUndo(GUI_UNDO_PATTERN_FLIP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue