/* * Copyright (c) 2021, Tobias Christiansen * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include "../Guide.h" #include "Tool.h" #include namespace PixelPaint { class GuideTool final : public Tool { public: GuideTool(); virtual ~GuideTool() override; virtual void on_mousedown(Layer*, MouseEvent&) override; virtual void on_mousemove(Layer*, MouseEvent&) override; virtual void on_mouseup(Layer*, MouseEvent&) override; virtual void on_context_menu(Layer*, GUI::ContextMenuEvent&) override; virtual void on_tool_activation() override; virtual GUI::Widget* get_properties_widget() override; virtual Gfx::StandardCursor cursor() override { return Gfx::StandardCursor::Crosshair; } private: RefPtr closest_guide(Gfx::IntPoint const&); RefPtr m_properties_widget; RefPtr m_selected_guide; RefPtr m_context_menu_guide; Gfx::IntPoint m_event_origin; float m_guide_origin { 0 }; RefPtr m_context_menu; int m_snap_size { 10 }; }; }