diff --git a/CMakeLists.txt b/CMakeLists.txt index f26900a..78890b2 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,7 +87,6 @@ set(sources "src/main.cpp" "src/DrawingProgram/Tools/EyeDropperTool.cpp" "src/DrawingProgram/Tools/ScreenshotTool.cpp" "src/DrawingProgram/Tools/EditTool.cpp" - "src/DrawingProgram/Tools/FillTool.cpp" "src/DrawingProgram/Tools/ZoomCanvasTool.cpp" "src/DrawingProgram/Tools/PanCanvasTool.cpp" "src/DrawingProgram/Tools/GridModifyTool.cpp" diff --git a/assets/data/icons/RemixIcon/paint-line.svg b/assets/data/icons/RemixIcon/paint-line.svg deleted file mode 100644 index 2f5efbf..0000000 --- a/assets/data/icons/RemixIcon/paint-line.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/DrawingProgram/DrawingProgram.cpp b/src/DrawingProgram/DrawingProgram.cpp index d1c38de..9263834 100644 --- a/src/DrawingProgram/DrawingProgram.cpp +++ b/src/DrawingProgram/DrawingProgram.cpp @@ -400,7 +400,6 @@ void DrawingProgram::toolbar_gui(Toolbar& t) { tool_button("Brush Toolbar Button", "data/icons/brush.svg", DrawingProgramToolType::BRUSH); tool_button("Eraser Toolbar Button", "data/icons/eraser.svg", DrawingProgramToolType::ERASER); - tool_button("Fill Toolbar Button", "data/icons/RemixIcon/paint-line.svg", DrawingProgramToolType::FILL); tool_button("Line Toolbar Button", "data/icons/line.svg", DrawingProgramToolType::LINE); tool_button("Text Toolbar Button", "data/icons/text.svg", DrawingProgramToolType::TEXTBOX); tool_button("Ellipse Toolbar Button", "data/icons/circle.svg", DrawingProgramToolType::ELLIPSE); diff --git a/src/DrawingProgram/Tools/DrawingProgramToolBase.cpp b/src/DrawingProgram/Tools/DrawingProgramToolBase.cpp index 9de0700..529ff01 100644 --- a/src/DrawingProgram/Tools/DrawingProgramToolBase.cpp +++ b/src/DrawingProgram/Tools/DrawingProgramToolBase.cpp @@ -20,7 +20,6 @@ #include "BrushTool.hpp" #include "EraserTool.hpp" -#include "FillTool.hpp" #include "PanCanvasTool.hpp" #include "RectSelectTool.hpp" #include "LassoSelectTool.hpp" @@ -46,8 +45,6 @@ std::unique_ptr DrawingProgramToolBase::allocate_tool_ty return std::make_unique(drawP); case DrawingProgramToolType::ERASER: return std::make_unique(drawP); - case DrawingProgramToolType::FILL: - return std::make_unique(drawP); case DrawingProgramToolType::LASSOSELECT: return std::make_unique(drawP); case DrawingProgramToolType::RECTSELECT: diff --git a/src/DrawingProgram/Tools/DrawingProgramToolBase.hpp b/src/DrawingProgram/Tools/DrawingProgramToolBase.hpp index c277f6c..8a6ebad 100644 --- a/src/DrawingProgram/Tools/DrawingProgramToolBase.hpp +++ b/src/DrawingProgram/Tools/DrawingProgramToolBase.hpp @@ -30,7 +30,6 @@ class PhoneDrawingProgramScreen; enum class DrawingProgramToolType : int { BRUSH = 0, ERASER, - FILL, LASSOSELECT, RECTSELECT, RECTANGLE, diff --git a/src/DrawingProgram/Tools/FillTool.cpp b/src/DrawingProgram/Tools/FillTool.cpp deleted file mode 100644 index 776bc19..0000000 --- a/src/DrawingProgram/Tools/FillTool.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* - * InfiniPaint - * Copyright (C) 2025-2026 Yousef Khadadeh - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "FillTool.hpp" -#include "../DrawingProgram.hpp" -#include "../../MainProgram.hpp" -#include "../../DrawData.hpp" -#include "DrawingProgramToolBase.hpp" -#include "../../CoordSpaceHelper.hpp" -#include "../../GUIStuff/ElementHelpers/TextLabelHelpers.hpp" -#include "../../CanvasComponents/MeshCanvasComponent.hpp" - -FillTool::FillTool(DrawingProgram& initDrawP): - DrawingProgramToolBase(initDrawP) -{} - -DrawingProgramToolType FillTool::get_type() { - return DrawingProgramToolType::FILL; -} - -void FillTool::gui_toolbox(Toolbar& t) { - auto& gui = drawP.world.main.g.gui; - gui.new_id("fill tool", [&] { - GUIStuff::ElementHelpers::text_label_centered(gui, "Fill"); - }); -} - -void FillTool::gui_phone_toolbox(PhoneDrawingProgramScreen& t) { - auto& gui = drawP.world.main.g.gui; - gui.new_id("fill tool", [&] { - }); -} - -void FillTool::right_click_popup_gui(Toolbar& t, Vector2f popupPos) { - drawP.selection_action_menu(popupPos); -} - -void FillTool::input_mouse_button_on_canvas_callback(const InputManager::MouseButtonCallbackArgs& button) { - if(button.button == InputManager::MouseButton::LEFT) { - if(button.down && drawP.layerMan.is_a_layer_being_edited() && !drawP.world.main.g.gui.cursor_obstructed()) { - auto& toolConfig = drawP.world.main.toolConfig; - - CanvasComponentContainer* newContainer = new CanvasComponentContainer(drawP.world.netObjMan, CanvasComponentType::MESH); - MeshCanvasComponent& newMesh = static_cast(newContainer->get_comp()); - - newMesh.d.color = toolConfig.globalConf.foregroundColor; - //newMesh.d.points.contours.emplace_back(); - //newMesh.d.points.contours.back().emplace_back(button.pos + Vector2f{0.0f, 100.0f}); - //newMesh.d.points.contours.back().emplace_back(button.pos + Vector2f{-100.0f, -100.0f}); - //newMesh.d.points.contours.back().emplace_back(button.pos + Vector2f{100.0f, -100.0f}); - newContainer->coords = drawP.world.drawData.cam.c; - - objInfoBeingEdited = drawP.layerMan.add_component_to_layer_being_edited(newContainer); - - objInfoBeingEdited->obj->commit_update(drawP); - objInfoBeingEdited->obj->send_comp_update(drawP, true); - - drawP.layerMan.add_undo_place_component(objInfoBeingEdited); - - objInfoBeingEdited = nullptr; - } - } -} - -Vector4f* FillTool::color_picker_color(Vector4f* oldColor) { - return nullptr; -} - -void FillTool::erase_component(CanvasComponentContainer::ObjInfo* erasedComp) { -} - -void FillTool::switch_tool(DrawingProgramToolType newTool) { -} - -void FillTool::tool_update() { -} - -bool FillTool::prevent_undo_or_redo() { - return false; -} - -void FillTool::draw(SkCanvas* canvas, const DrawData& drawData) { -} diff --git a/src/DrawingProgram/Tools/FillTool.hpp b/src/DrawingProgram/Tools/FillTool.hpp deleted file mode 100644 index 02ab1fb..0000000 --- a/src/DrawingProgram/Tools/FillTool.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * InfiniPaint - * Copyright (C) 2025-2026 Yousef Khadadeh - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include -#include "../../DrawData.hpp" -#include -#include "../../CoordSpaceHelper.hpp" -#include "DrawingProgramToolBase.hpp" - -class DrawingProgram; - -class FillTool : public DrawingProgramToolBase { - public: - FillTool(DrawingProgram& initDrawP); - virtual DrawingProgramToolType get_type() override; - virtual void gui_toolbox(Toolbar& t) override; - virtual void gui_phone_toolbox(PhoneDrawingProgramScreen& t) override; - virtual void right_click_popup_gui(Toolbar& t, Vector2f popupPos) override; - virtual void erase_component(CanvasComponentContainer::ObjInfo* erasedComp) override; - virtual void tool_update() override; - virtual void draw(SkCanvas* canvas, const DrawData& drawData) override; - virtual void switch_tool(DrawingProgramToolType newTool) override; - virtual bool prevent_undo_or_redo() override; - virtual Vector4f* color_picker_color(Vector4f* oldColor) override; - virtual void input_mouse_button_on_canvas_callback(const InputManager::MouseButtonCallbackArgs& button) override; - private: - CanvasComponentContainer::ObjInfo* objInfoBeingEdited = nullptr; -};