mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 09:49:21 +00:00
PixelPaint: Make filters apply to a selection if one is present
This changes ImageProcessor to use the scratch bitmap of the layer which will cause the changes to only be applied inside the active selection (if there is one). This also updates the FilterPreviewWidget to show the filter preview with active selection taken into account.
This commit is contained in:
parent
6911c5545c
commit
75c359ef31
Notes:
sideshowbarker
2024-07-17 04:38:59 +09:00
Author: https://github.com/tslater2006
Commit: 75c359ef31
Pull-request: https://github.com/SerenityOS/serenity/pull/15886
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/kleinesfilmroellchen
4 changed files with 25 additions and 3 deletions
|
@ -16,7 +16,7 @@ FilterApplicationCommand::FilterApplicationCommand(NonnullRefPtr<Filter> filter,
|
|||
|
||||
void FilterApplicationCommand::execute()
|
||||
{
|
||||
m_filter->apply(m_target_layer->content_bitmap(), m_target_layer->content_bitmap());
|
||||
m_filter->apply(m_target_layer->get_scratch_edited_bitmap(), m_target_layer->get_scratch_edited_bitmap());
|
||||
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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue