mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 13:43:45 +03:00
PixelPaint: FilterGallery fix preview
This patch fixes an issue where the preview for an filter was always based on the content bitmap even if the edit mode was set to Mask. Now the preview is using the content or mask bitmap based on the current edit mode and therefore generates the correct preview of what is going to be changed.
This commit is contained in:
parent
d9d9103cbb
commit
0c95564533
Notes:
sideshowbarker
2024-07-17 10:05:47 +09:00
Author: https://github.com/Torstennator Commit: https://github.com/SerenityOS/serenity/commit/0c95564533 Pull-request: https://github.com/SerenityOS/serenity/pull/18817 Reviewed-by: https://github.com/gmta ✅
@ -74,7 +74,14 @@ FilterGallery::FilterGallery(GUI::Window* parent_window, ImageEditor* editor)
|
||||
};
|
||||
|
||||
m_preview_widget->set_layer(editor->active_layer());
|
||||
switch (editor->active_layer()->edit_mode()) {
|
||||
case Layer::EditMode::Content:
|
||||
m_preview_widget->set_bitmap(editor->active_layer()->content_bitmap().clone().release_value());
|
||||
break;
|
||||
case Layer::EditMode::Mask:
|
||||
m_preview_widget->set_bitmap(editor->active_layer()->mask_bitmap()->clone().release_value());
|
||||
break;
|
||||
}
|
||||
|
||||
apply_button->on_click = [this](auto) {
|
||||
if (!m_selected_filter) {
|
||||
|
Loading…
Reference in New Issue
Block a user