Remove incomplete fill tool for next release

This commit is contained in:
Yousef Khadadeh 2026-06-03 11:52:26 +03:00
parent 279a9317a4
commit cdbeb838ab
7 changed files with 0 additions and 149 deletions

View file

@ -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);

View file

@ -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> DrawingProgramToolBase::allocate_tool_ty
return std::make_unique<BrushTool>(drawP);
case DrawingProgramToolType::ERASER:
return std::make_unique<EraserTool>(drawP);
case DrawingProgramToolType::FILL:
return std::make_unique<FillTool>(drawP);
case DrawingProgramToolType::LASSOSELECT:
return std::make_unique<LassoSelectTool>(drawP);
case DrawingProgramToolType::RECTSELECT:

View file

@ -30,7 +30,6 @@ class PhoneDrawingProgramScreen;
enum class DrawingProgramToolType : int {
BRUSH = 0,
ERASER,
FILL,
LASSOSELECT,
RECTSELECT,
RECTANGLE,

View file

@ -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 <https://www.gnu.org/licenses/>.
*/
#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<MeshCanvasComponent&>(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) {
}

View file

@ -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 <https://www.gnu.org/licenses/>.
*/
#pragma once
#include <include/core/SkCanvas.h>
#include "../../DrawData.hpp"
#include <Helpers/SCollision.hpp>
#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;
};