Eraser tool works with events
This commit is contained in:
parent
803eb2c08a
commit
6effc6de56
3 changed files with 77 additions and 50 deletions
|
|
@ -17,6 +17,12 @@ class EraserTool : public DrawingProgramToolBase {
|
|||
virtual void switch_tool(DrawingProgramToolType newTool) override;
|
||||
virtual void draw(SkCanvas* canvas, const DrawData& drawData) override;
|
||||
virtual bool prevent_undo_or_redo() override;
|
||||
virtual void input_mouse_button_on_canvas_callback(const InputManager::MouseButtonCallbackArgs& button) override;
|
||||
virtual void input_mouse_motion_callback(const InputManager::MouseMotionCallbackArgs& motion) override;
|
||||
|
||||
std::unordered_set<CanvasComponentContainer::ObjInfo*> erasedComponents; // Pointers will be erased from this set if theyre erased in the main list (done by callback)
|
||||
private:
|
||||
void erase_between_points(const Vector2f& start, const Vector2f& end);
|
||||
std::optional<Vector2f> lastPosOpt;
|
||||
bool isErasing = false;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue