diff options
author | Marcus Nilsson <brainbomb@gmail.com> | 2021-08-13 22:40:29 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-14 12:45:48 +0200 |
commit | 1ad08ab7d64a3809f866aeb62451cc58cd8accfc (patch) | |
tree | 86a899be3d46648208fcf3b9a0cee2c0b4581200 /Userland/Applications/PixelPaint/ImageEditor.cpp | |
parent | 3b3df40eb92601dcc57b502a91d785b271e35655 (diff) | |
download | serenity-1ad08ab7d64a3809f866aeb62451cc58cd8accfc.zip |
PixelPaint: Show Guides on GuideTool activation
This adds on_tool_activation() to Tool which GuideTool can use
to show guides, if they're hidden, when it's activated. Also
show guides on mousedown since there's no use in drawing invisible
guides.
Diffstat (limited to 'Userland/Applications/PixelPaint/ImageEditor.cpp')
-rw-r--r-- | Userland/Applications/PixelPaint/ImageEditor.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Userland/Applications/PixelPaint/ImageEditor.cpp b/Userland/Applications/PixelPaint/ImageEditor.cpp index f180b5e110..248f37a611 100644 --- a/Userland/Applications/PixelPaint/ImageEditor.cpp +++ b/Userland/Applications/PixelPaint/ImageEditor.cpp @@ -316,10 +316,24 @@ void ImageEditor::set_active_tool(Tool* tool) if (m_active_tool) { m_active_tool->setup(*this); + m_active_tool->on_tool_activation(); m_active_cursor = m_active_tool->cursor(); } } +void ImageEditor::set_guide_visibility(bool show_guides) +{ + if (m_show_guides == show_guides) + return; + + m_show_guides = show_guides; + + if (on_set_guide_visibility) + on_set_guide_visibility(m_show_guides); + + update(); +} + void ImageEditor::layers_did_change() { update(); |