mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
PixelPaint: Remove todo from LevelDialog
This patch removes a todo where the revert for any changes could be optimized. Previously every single pixel was copied back from the reference bitmap to the content bitmap. Now the editors content bitmap is just replaced with the reference bitmap that is a copy of the unchanged content bitmap.
This commit is contained in:
parent
1f31e72843
commit
0a120e239a
1 changed files with 1 additions and 7 deletions
|
@ -71,16 +71,10 @@ LevelsDialog::LevelsDialog(GUI::Window* parent_window, ImageEditor* editor)
|
|||
|
||||
void LevelsDialog::revert_possible_changes()
|
||||
{
|
||||
// FIXME: Find a faster way to revert all the changes that we have done.
|
||||
if (m_did_change && m_reference_bitmap) {
|
||||
for (int x = 0; x < m_reference_bitmap->width(); x++) {
|
||||
for (int y = 0; y < m_reference_bitmap->height(); y++) {
|
||||
m_editor->active_layer()->content_bitmap().set_pixel(x, y, m_reference_bitmap->get_pixel(x, y));
|
||||
}
|
||||
}
|
||||
MUST(m_editor->active_layer()->set_bitmaps(m_reference_bitmap.release_nonnull(), m_editor->active_layer()->mask_bitmap()));
|
||||
m_editor->layers_did_change();
|
||||
}
|
||||
|
||||
cleanup_resources();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue