mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
PixelPaint: Correct active tool ImageEditor sync issue
This fixes a scenario in which the active tool can get out of sync in regards to what it believes it the current ImageEditor. In the case where multiple images are open, switching between the editor tabs with a tool selected can lead to this unsynchronized state due to a check that the ImageEditor's active tool matches the current tool. If this is the case the method returns early before we properly set the new editor pointer on the active tool.
This commit is contained in:
committed by
Andrew Kaster
parent
8768417b1c
commit
461ee18d64
@@ -490,8 +490,11 @@ ErrorOr<void> ImageEditor::add_new_layer_from_selection()
|
||||
|
||||
void ImageEditor::set_active_tool(Tool* tool)
|
||||
{
|
||||
if (m_active_tool == tool)
|
||||
if (m_active_tool == tool) {
|
||||
if (m_active_tool)
|
||||
m_active_tool->setup(*this);
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_active_tool)
|
||||
m_active_tool->clear();
|
||||
|
||||
Reference in New Issue
Block a user