mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
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.
This commit is contained in:
parent
3b3df40eb9
commit
1ad08ab7d6
6 changed files with 40 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue