Skip to content

Commit

Permalink
simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
jowin202 committed Mar 11, 2024
1 parent e20a45b commit 79da4b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
12 changes: 2 additions & 10 deletions rotations/rotationdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,17 +316,9 @@ void RotationDialog::on_button_ok_clicked()
opt->undoDB.append(opt->data);

QJsonArray sprites = opt->data.value("sprites").toArray();

int skip = 1; //insert 1 later when original is kept
if (this->ui->check_replace->isChecked())
{
sprites.removeAt(opt->current_sprite);
skip = 0;
}

for (int i = 0; i < result_list.count(); i++)
for (int i = 1; i < result_list.count(); i++)
{
sprites.insert(opt->current_sprite+skip+i, result_list.at(i));
sprites.insert(opt->current_sprite+i, result_list.at(i));
}

opt->data.insert("sprites", sprites);
Expand Down
7 changes: 0 additions & 7 deletions rotations/rotationdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="check_replace">
<property name="text">
<string>Replace original</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="button_cancel">
<property name="text">
Expand Down

0 comments on commit 79da4b7

Please sign in to comment.