PixelPaint: Don't const_cast to update the editor on filter application

This commit is contained in:
Zaggy1024 2023-08-06 02:46:19 -05:00 committed by Daniel Bertalan
parent faf9d08371
commit ba236e3f21
Notes: sideshowbarker 2024-07-17 18:46:57 +09:00

View file

@ -30,8 +30,7 @@ void FilterApplicationCommand::execute()
}
m_filter->m_editor->gui_event_loop().deferred_invoke([strong_this = NonnullRefPtr(*this)]() {
// HACK: we can't tell strong_this to not be const
(*const_cast<NonnullRefPtr<Layer>*>(&strong_this->m_target_layer))->did_modify_bitmap(strong_this->m_target_layer->rect());
strong_this->m_target_layer->did_modify_bitmap(strong_this->m_target_layer->rect());
strong_this->m_filter->m_editor->did_complete_action(DeprecatedString::formatted("Filter {}", strong_this->m_filter->filter_name()));
});
}