Improved custom event code and fixed some warnings

This commit is contained in:
Yousef Khadadeh 2026-04-11 16:36:24 +03:00
parent da1a1c26cb
commit b2fe1ab7ba
52 changed files with 193 additions and 240 deletions

View file

@ -58,16 +58,19 @@ void DrawingProgram::on_tab_out() {
controls.middleClickHeld = false;
}
void DrawingProgram::input_paste_callback(const CustomEvents::PasteEventData& paste) {
drawTool->input_paste_callback(paste);
void DrawingProgram::input_paste_callback(const CustomEvents::PasteEvent& paste) {
if(paste.type == CustomEvents::PasteEvent::DataType::IMAGE)
selection.paste_image_process_event(paste);
else
drawTool->input_paste_callback(paste);
}
void DrawingProgram::input_drop_file_callback(const InputManager::DropCallbackArgs& drop) {
if(std::filesystem::is_regular_file(drop.data)) {
#ifdef __EMSCRIPTEN_
add_file_to_canvas_by_path(drop.data, world.main.input.mouse.pos, true);
add_file_to_canvas_by_path(drop.data, world.main.input.mouse.pos);
#else
add_file_to_canvas_by_path(drop.data, drop.pos, true);
add_file_to_canvas_by_path(drop.data, drop.pos);
#endif
}
}
@ -422,7 +425,10 @@ void DrawingProgram::popup_menu_action_button(const char* id, const char* text,
.drawType = GUIStuff::SelectableButton::DrawType::TRANSPARENT_ALL,
.wide = true,
.centered = false,
.onClick = onClick
.onClick = [&, onClick] {
onClick();
clear_right_click_popup();
}
});
}
@ -442,7 +448,9 @@ void DrawingProgram::selection_action_menu(Vector2f popupPos) {
});
popup_menu_action_button("Paste Image", "Paste Image", [&, popupPos] {
selection.deselect_all();
selection.paste_image(popupPos * world.main.g.final_gui_scale());
world.main.input.call_paste(CustomEvents::PasteEvent::DataType::IMAGE, {
.pastePosition = popupPos * world.main.g.final_gui_scale()
});
});
if(selection.is_something_selected()) {
popup_menu_action_button("Copy", "Copy", [&] {
@ -463,8 +471,8 @@ void DrawingProgram::selection_action_menu(Vector2f popupPos) {
});
}
}, LayoutElement::Callbacks{
.mouseButton = [&](LayoutElement*, const InputManager::MouseButtonCallbackArgs& button) {
if(button.down && button.button != InputManager::MouseButton::RIGHT)
.mouseButton = [&](LayoutElement* l, const InputManager::MouseButtonCallbackArgs& button) {
if(button.down && button.button != InputManager::MouseButton::RIGHT && !l->mouseHovering)
clear_right_click_popup();
}
});
@ -510,11 +518,6 @@ void DrawingProgram::modify_grid(const NetworkingObjects::NetObjWeakPtr<WorldGri
}
void DrawingProgram::update() {
if(addFileInNextFrame) {
add_file_to_canvas_by_path_execute(addFileInfo.first, addFileInfo.second);
addFileInNextFrame = false;
}
selection.update();
drawTool->tool_update();
@ -652,16 +655,11 @@ void DrawingProgram::update_downloading_dropped_files() {
});
}
void DrawingProgram::add_file_to_canvas_by_path(const std::filesystem::path& filePath, Vector2f dropPos, bool addInSameThread) {
if(addInSameThread)
add_file_to_canvas_by_path_execute(filePath, dropPos);
else if(!addFileInNextFrame) {
addFileInfo = {filePath, dropPos};
addFileInNextFrame = true;
}
void DrawingProgram::input_add_file_to_canvas_callback(const CustomEvents::AddFileToCanvasEvent& addFile) {
add_file_to_canvas_by_path(addFile.filePath, addFile.pos);
}
void DrawingProgram::add_file_to_canvas_by_path_execute(const std::filesystem::path& filePath, Vector2f dropPos) {
void DrawingProgram::add_file_to_canvas_by_path(const std::filesystem::path& filePath, Vector2f dropPos) {
if(layerMan.is_a_layer_being_edited()) {
NetworkingObjects::NetObjTemporaryPtr<ResourceData> imageTempPtr = world.rMan.add_resource_file(filePath);
if(imageTempPtr) {

View file

@ -36,7 +36,7 @@ class DrawingProgram {
void read_components_client(cereal::PortableBinaryInputArchive& a);
void init_server_callbacks();
void init_client_callbacks();
void add_file_to_canvas_by_path(const std::filesystem::path& filePath, Vector2f dropPos, bool addInSameThread);
void add_file_to_canvas_by_path(const std::filesystem::path& filePath, Vector2f dropPos);
CanvasComponentContainer::ObjInfo* add_file_to_canvas_by_data(const std::string& fileName, std::string_view fileBuffer, Vector2f dropPos);
void get_used_resources(std::unordered_set<NetworkingObjects::NetObjID>& resourceSet);
@ -59,7 +59,8 @@ class DrawingProgram {
void send_transforms_for(const std::vector<CanvasComponentContainer::ObjInfo*>& objsToSendTransformsFor);
void on_tab_out();
void input_paste_callback(const CustomEvents::PasteEventData& paste);
void input_add_file_to_canvas_callback(const CustomEvents::AddFileToCanvasEvent& addFile);
void input_paste_callback(const CustomEvents::PasteEvent& paste);
void input_drop_text_callback(const InputManager::DropCallbackArgs& drop);
void input_drop_file_callback(const InputManager::DropCallbackArgs& drop);
void input_text_key_callback(const InputManager::KeyCallbackArgs& key);
@ -80,7 +81,6 @@ class DrawingProgram {
void process_transform_message(const std::vector<std::pair<NetworkingObjects::NetObjID, CoordSpaceHelper>>& transforms);
void drag_drop_update();
void add_file_to_canvas_by_path_execute(const std::filesystem::path& filePath, Vector2f dropPos);
void check_updateable_components();
void update_downloading_dropped_files();
@ -88,9 +88,6 @@ class DrawingProgram {
void popup_menu_action_button(const char* id, const char* text, const std::function<void()>& onClick);
void rebuild_cache();
std::atomic<bool> addFileInNextFrame = false;
std::pair<std::filesystem::path, Vector2f> addFileInfo;
float drag_point_radius();
void draw_drag_circle(SkCanvas* canvas, const Vector2f& pos, const SkColor4f& c, const DrawData& drawData, float radiusMultiplier = 1.0f);
SkPaint select_tool_line_paint(const DrawData& drawData);

View file

@ -5,7 +5,6 @@
#include "../InputManager.hpp"
#include <Helpers/Parallel.hpp>
#include <Helpers/Logger.hpp>
#include <chrono>
#ifdef USE_SKIA_BACKEND_GRAPHITE
#include <include/gpu/graphite/Surface.h>
@ -423,7 +422,9 @@ void DrawingProgramSelection::input_key_callback_display_selection(const InputMa
case InputManager::KEY_PASTE_IMAGE: {
if(key.down && !key.repeat) {
deselect_all();
paste_image(drawP.world.main.input.mouse.pos);
drawP.world.main.input.call_paste(CustomEvents::PasteEvent::DataType::IMAGE, {
.pastePosition = drawP.world.main.input.mouse.pos
});
drawP.world.main.g.gui.set_to_layout();
}
break;
@ -689,39 +690,19 @@ void DrawingProgramSelection::paste_clipboard(Vector2f pasteScreenPos) {
}
}
void DrawingProgramSelection::paste_image(Vector2f pasteScreenPos) {
void DrawingProgramSelection::paste_image_process_event(const CustomEvents::PasteEvent& paste) {
check_add_stroke_color_change_undo();
if(drawP.layerMan.is_a_layer_being_edited()) {
#ifdef __EMSCRIPTEN__
struct PasteData {
std::weak_ptr<World> w;
Vector2f screenPos;
};
static PasteData pasteData;
pasteData.screenPos = pasteScreenPos;
pasteData.w = make_weak_ptr(drawP.world.main.world);
emscripten_browser_clipboard::paste_async_image([](std::string_view pasteData, void* callbackData){
PasteData* p = (PasteData*)callbackData;
std::shared_ptr<World> wLock = p->w.lock();
if(wLock)
wLock->drawProg.add_file_to_canvas_by_data("Image from clipboard", pasteData, p->screenPos);
else
Logger::get().log("INFO", "Loading image to canvas that has been destroyed");
}, &pasteData);
#else
if(!drawP.is_selection_allowing_tool(drawP.drawTool->get_type()))
drawP.switch_to_tool(DrawingProgramToolType::EDIT);
if(!drawP.is_selection_allowing_tool(drawP.drawTool->get_type()))
drawP.switch_to_tool(DrawingProgramToolType::EDIT);
std::vector<CanvasComponentContainer::ObjInfo*> compSetInserted;
drawP.world.main.input.get_clipboard_image_data_SDL([&](std::string_view pasteData) {
compSetInserted.emplace_back(drawP.add_file_to_canvas_by_data("Image from clipboard", pasteData, pasteScreenPos));
});
if(!compSetInserted.empty() && compSetInserted.back() != nullptr) {
drawP.drawCache.erase_component(compSetInserted.back());
set_to_selection(compSetInserted);
}
#endif
std::vector<CanvasComponentContainer::ObjInfo*> compSetInserted;
compSetInserted.emplace_back(drawP.add_file_to_canvas_by_data("Image from clipboard", paste.data, paste.mousePos.value()));
if(compSetInserted.back() != nullptr) {
drawP.drawCache.erase_component(compSetInserted.back());
set_to_selection(compSetInserted);
}
}
}

View file

@ -22,7 +22,7 @@ class DrawingProgramSelection {
void sort_selection();
void deselect_all();
void paste_clipboard(Vector2f pasteScreenPos);
void paste_image(Vector2f pasteScreenPos);
void paste_image_process_event(const CustomEvents::PasteEvent& paste);
std::unordered_set<CanvasComponentContainer::ObjInfo*> get_selection_as_set();
void push_selection_to_front();
void push_selection_to_back();

View file

@ -6,9 +6,7 @@
#include "DrawingProgramToolBase.hpp"
#include "../../CanvasComponents/BrushStrokeCanvasComponent.hpp"
#include "Helpers/NetworkingObjects/NetObjTemporaryPtr.decl.hpp"
#include "Helpers/NetworkingObjects/NetObjWeakPtr.hpp"
#include "../../CanvasComponents/CanvasComponentContainer.hpp"
#include <chrono>
#include "../../GUIStuff/ElementHelpers/TextLabelHelpers.hpp"
#include "../../GUIStuff/ElementHelpers/CheckBoxHelpers.hpp"
@ -176,7 +174,6 @@ void BrushTool::gui_toolbox() {
using namespace GUIStuff;
using namespace ElementHelpers;
Toolbar& t = drawP.world.main.toolbar;
auto& gui = drawP.world.main.g.gui;
gui.new_id("brush tool", [&] {

View file

@ -4,7 +4,6 @@
#include <include/core/SkPath.h>
#include <include/core/SkVertices.h>
#include <Helpers/SCollision.hpp>
#include <deque>
#include <include/core/SkCanvas.h>
#include "../../CanvasComponents/CanvasComponentContainer.hpp"
#include <Helpers/NetworkingObjects/NetObjWeakPtr.hpp>

View file

@ -55,7 +55,7 @@ std::unique_ptr<DrawingProgramToolBase> DrawingProgramToolBase::allocate_tool_ty
return nullptr;
}
void DrawingProgramToolBase::input_paste_callback(const CustomEvents::PasteEventData& paste) {}
void DrawingProgramToolBase::input_paste_callback(const CustomEvents::PasteEvent& paste) {}
void DrawingProgramToolBase::input_text_key_callback(const InputManager::KeyCallbackArgs& key) {}
void DrawingProgramToolBase::input_text_callback(const InputManager::TextCallbackArgs& text) {}
void DrawingProgramToolBase::input_key_callback(const InputManager::KeyCallbackArgs& key) {}

View file

@ -36,7 +36,7 @@ class DrawingProgramToolBase {
virtual void draw(SkCanvas* canvas, const DrawData& drawData) = 0;
virtual void switch_tool(DrawingProgramToolType newTool) = 0;
virtual bool prevent_undo_or_redo() = 0;
virtual void input_paste_callback(const CustomEvents::PasteEventData& paste);
virtual void input_paste_callback(const CustomEvents::PasteEvent& paste);
virtual void input_text_key_callback(const InputManager::KeyCallbackArgs& key);
virtual void input_text_callback(const InputManager::TextCallbackArgs& text);
virtual void input_key_callback(const InputManager::KeyCallbackArgs& key);

View file

@ -1,5 +1,4 @@
#include "EditTool.hpp"
#include <chrono>
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
#include "../../DrawData.hpp"
@ -29,7 +28,6 @@ void EditTool::gui_toolbox() {
using namespace GUIStuff;
using namespace ElementHelpers;
Toolbar& t = drawP.world.main.toolbar;
auto& gui = drawP.world.main.g.gui;
if(objInfoBeingEdited)
@ -46,7 +44,7 @@ void EditTool::erase_component(CanvasComponentContainer::ObjInfo* erasedComp) {
switch_tool(get_type());
}
void EditTool::input_paste_callback(const CustomEvents::PasteEventData& paste) {
void EditTool::input_paste_callback(const CustomEvents::PasteEvent& paste) {
if(objInfoBeingEdited)
compEditTool->input_paste_callback(paste);
}

View file

@ -26,7 +26,7 @@ class EditTool : 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_paste_callback(const CustomEvents::PasteEventData& paste) override;
virtual void input_paste_callback(const CustomEvents::PasteEvent& paste) override;
virtual void input_text_key_callback(const InputManager::KeyCallbackArgs& key) override;
virtual void input_text_callback(const InputManager::TextCallbackArgs& text) override;
virtual void input_key_callback(const InputManager::KeyCallbackArgs& key) override;

View file

@ -3,6 +3,7 @@
#include "../../../World.hpp"
#include "../../../MainProgram.hpp"
#include "../EditTool.hpp"
#include "../../../CanvasComponents/BrushStrokeCanvasComponent.hpp"
#include "../../../GUIStuff/ElementHelpers/TextLabelHelpers.hpp"
#include "../../../GUIStuff/ElementHelpers/LayoutHelpers.hpp"

View file

@ -1,6 +1,5 @@
#pragma once
#include "DrawingProgramEditToolBase.hpp"
#include "../../../CanvasComponents/BrushStrokeCanvasComponent.hpp"
#include <Helpers/SCollision.hpp>
#include <any>

View file

@ -11,7 +11,7 @@ void DrawingProgramEditToolBase::right_click_popup_gui(Vector2f popupPos) {
t.paint_popup(popupPos);
}
void DrawingProgramEditToolBase::input_paste_callback(const CustomEvents::PasteEventData& paste) {}
void DrawingProgramEditToolBase::input_paste_callback(const CustomEvents::PasteEvent& paste) {}
void DrawingProgramEditToolBase::input_text_key_callback(const InputManager::KeyCallbackArgs& key) {}
void DrawingProgramEditToolBase::input_text_callback(const InputManager::TextCallbackArgs& text) {}
void DrawingProgramEditToolBase::input_key_callback(const InputManager::KeyCallbackArgs& key) {}

View file

@ -14,7 +14,7 @@ class DrawingProgramEditToolBase {
virtual bool edit_update() = 0;
virtual void edit_gui() = 0;
virtual void right_click_popup_gui(Vector2f popupPos);
virtual void input_paste_callback(const CustomEvents::PasteEventData& paste);
virtual void input_paste_callback(const CustomEvents::PasteEvent& paste);
virtual void input_text_key_callback(const InputManager::KeyCallbackArgs& key);
virtual void input_text_callback(const InputManager::TextCallbackArgs& text);
virtual void input_key_callback(const InputManager::KeyCallbackArgs& key);

View file

@ -4,7 +4,6 @@
#include "../../../MainProgram.hpp"
#include "../../../DrawData.hpp"
#include <cereal/types/vector.hpp>
#include <memory>
#include "../EditTool.hpp"
#include "../../../GUIStuff/ElementHelpers/TextLabelHelpers.hpp"

View file

@ -8,7 +8,6 @@
#include "../EditTool.hpp"
#include "DrawingProgramEditToolBase.hpp"
#include "Eigen/Geometry"
#include <fstream>
#include "../../../GUIStuff/ElementHelpers/TextLabelHelpers.hpp"
#include "../../../GUIStuff/ElementHelpers/ButtonHelpers.hpp"

View file

@ -2,7 +2,6 @@
#include "../../DrawingProgram.hpp"
#include "../../../World.hpp"
#include "../../../MainProgram.hpp"
#include <memory>
#include "../EditTool.hpp"
#include "../../../GUIStuff/ElementHelpers/NumberSliderHelpers.hpp"

View file

@ -2,7 +2,6 @@
#include "../../DrawingProgram.hpp"
#include "../../../MainProgram.hpp"
#include "../../../DrawData.hpp"
#include "Helpers/ConvertVec.hpp"
#include "Helpers/SCollision.hpp"
#include <cereal/types/vector.hpp>
#include <include/core/SkFontStyle.h>
@ -204,7 +203,7 @@ void TextBoxEditTool::edit_gui() {
});
}
void TextBoxEditTool::input_paste_callback(const CustomEvents::PasteEventData& paste) {
void TextBoxEditTool::input_paste_callback(const CustomEvents::PasteEvent& paste) {
if(textboxID.has_value() && textboxID.value() == drawP.world.main.input.text.current_textbox_editing_id()) {
auto& a = static_cast<TextBoxCanvasComponent&>(comp->obj->get_comp());
if(userInput->input_paste_callback(paste)) {
@ -289,10 +288,10 @@ void TextBoxEditTool::right_click_popup_gui(Vector2f popupPos) {
text_label_light(gui, "Text menu");
InputManager& input = drawP.world.main.input;
drawP.popup_menu_action_button("Paste", "Paste", [&] {
drawP.world.main.input.call_paste(CustomEvents::PasteEventDataType::TEXT, { .allowRichText = true });
drawP.world.main.input.call_paste(CustomEvents::PasteEvent::DataType::TEXT, { .allowRichText = true });
});
drawP.popup_menu_action_button("Paste without formatting", "Paste without formatting", [&] {
drawP.world.main.input.call_paste(CustomEvents::PasteEventDataType::TEXT, { .allowRichText = false });
drawP.world.main.input.call_paste(CustomEvents::PasteEvent::DataType::TEXT, { .allowRichText = false });
});
if(a.cursor->selectionBeginPos != a.cursor->selectionEndPos) {
drawP.popup_menu_action_button("Copy", "Copy", [&] {

View file

@ -17,7 +17,7 @@ class TextBoxEditTool : public DrawingProgramEditToolBase {
virtual void edit_gui() override;
virtual void right_click_popup_gui(Vector2f popupPos) override;
virtual void input_paste_callback(const CustomEvents::PasteEventData& paste) override;
virtual void input_paste_callback(const CustomEvents::PasteEvent& paste) override;
virtual void input_text_key_callback(const InputManager::KeyCallbackArgs& key) override;
virtual void input_text_callback(const InputManager::TextCallbackArgs& text) override;
virtual void input_mouse_button_on_canvas_callback(const InputManager::MouseButtonCallbackArgs& button, bool isDraggingPoint) override;

View file

@ -24,7 +24,6 @@ void EllipseDrawTool::gui_toolbox() {
using namespace GUIStuff;
using namespace ElementHelpers;
Toolbar& t = drawP.world.main.toolbar;
auto& gui = drawP.world.main.g.gui;
auto& toolConfig = drawP.world.main.toolConfig;
auto& fillStrokeMode = toolConfig.ellipseDraw.fillStrokeMode;

View file

@ -20,7 +20,6 @@ void EraserTool::gui_toolbox() {
using namespace GUIStuff;
using namespace ElementHelpers;
Toolbar& t = drawP.world.main.toolbar;
auto& gui = drawP.world.main.g.gui;
gui.new_id("eraser tool", [&] {
text_label_centered(gui, "Eraser");

View file

@ -2,7 +2,6 @@
#include <include/core/SkCanvas.h>
#include "../../DrawData.hpp"
#include "DrawingProgramToolBase.hpp"
#include "../DrawingProgramCache.hpp"
class DrawingProgram;

View file

@ -30,7 +30,6 @@ void EyeDropperTool::gui_toolbox() {
using namespace GUIStuff;
using namespace ElementHelpers;
Toolbar& t = drawP.world.main.toolbar;
auto& gui = drawP.world.main.g.gui;
auto& selectingStrokeColor = drawP.world.main.toolConfig.eyeDropper.selectingStrokeColor;
gui.new_id("Color select tool", [&] {

View file

@ -2,11 +2,9 @@
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
#include "../../DrawData.hpp"
#include "Helpers/Networking/NetLibrary.hpp"
#include "Helpers/NetworkingObjects/NetObjTemporaryPtr.decl.hpp"
#include <Helpers/NetworkingObjects/NetObjWeakPtr.hpp>
#include <Helpers/NetworkingObjects/NetObjGenericSerializedClass.hpp>
#include <cstddef>
#include "../../GUIStuff/ElementHelpers/TextLabelHelpers.hpp"
#include "../../GUIStuff/ElementHelpers/LayoutHelpers.hpp"

View file

@ -7,7 +7,6 @@
#include "Helpers/SCollision.hpp"
#include "../../CoordSpaceHelper.hpp"
#include <ranges>
#include "../../DrawCollision.hpp"
#include <earcut.hpp>
#include <include/core/SkPathBuilder.h>
@ -41,7 +40,6 @@ DrawingProgramToolType LassoSelectTool::get_type() {
}
void LassoSelectTool::gui_toolbox() {
auto& t = drawP.world.main.toolbar;
auto& gui = drawP.world.main.g.gui;
gui.new_id("lasso select tool", [&] {
GUIStuff::ElementHelpers::text_label_centered(gui, "Lasso Select");

View file

@ -6,7 +6,6 @@
#include "../../CanvasComponents/BrushStrokeCanvasComponent.hpp"
#include "../../CanvasComponents/CanvasComponentContainer.hpp"
#include "Helpers/MathExtras.hpp"
#include <limits>
#include "../../GUIStuff/ElementHelpers/TextLabelHelpers.hpp"
#include "../../GUIStuff/ElementHelpers/CheckBoxHelpers.hpp"
@ -22,7 +21,6 @@ DrawingProgramToolType LineDrawTool::get_type() {
void LineDrawTool::gui_toolbox() {
using namespace GUIStuff;
using namespace ElementHelpers;
Toolbar& t = drawP.world.main.toolbar;
auto& gui = drawP.world.main.g.gui;
auto& toolConfig = drawP.world.main.toolConfig;
gui.new_id("rect draw tool", [&] {

View file

@ -17,7 +17,6 @@ DrawingProgramToolType PanCanvasTool::get_type() {
}
void PanCanvasTool::gui_toolbox() {
Toolbar& t = drawP.world.main.toolbar;
auto& gui = drawP.world.main.g.gui;
gui.new_id("Pan canvas tool", [&] {
GUIStuff::ElementHelpers::text_label_centered(gui, "Pan tool");

View file

@ -22,7 +22,6 @@ void RectDrawTool::gui_toolbox() {
using namespace GUIStuff;
using namespace ElementHelpers;
Toolbar& t = drawP.world.main.toolbar;
auto& gui = drawP.world.main.g.gui;
auto& toolConfig = drawP.world.main.toolConfig;
auto& fillStrokeMode = toolConfig.rectDraw.fillStrokeMode;

View file

@ -19,7 +19,6 @@ DrawingProgramToolType RectSelectTool::get_type() {
}
void RectSelectTool::gui_toolbox() {
auto& t = drawP.world.main.toolbar;
auto& gui = drawP.world.main.g.gui;
gui.new_id("rectangle select tool", [&] {
GUIStuff::ElementHelpers::text_label_centered(gui, "Rectangle Select");

View file

@ -17,9 +17,7 @@
#include <include/encode/SkPngEncoder.h>
#include <include/encode/SkWebpEncoder.h>
#include <include/encode/SkJpegEncoder.h>
#include <fstream>
#include <include/gpu/GpuTypes.h>
#include "../../FileHelpers.hpp"
#include <filesystem>
#ifdef USE_SKIA_BACKEND_GRAPHITE
#include <include/gpu/graphite/Surface.h>

View file

@ -1,10 +1,8 @@
#include "TextBoxTool.hpp"
#include <chrono>
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
#include "../../DrawData.hpp"
#include "Helpers/MathExtras.hpp"
#include "Helpers/SCollision.hpp"
#include <cereal/types/vector.hpp>
#include <memory>
#include "../../CanvasComponents/TextBoxCanvasComponent.hpp"
@ -22,7 +20,6 @@ DrawingProgramToolType TextBoxTool::get_type() {
}
void TextBoxTool::gui_toolbox() {
Toolbar& t = drawP.world.main.toolbar;
auto& gui = drawP.world.main.g.gui;
gui.new_id("textbox tool", [&] {
GUIStuff::ElementHelpers::text_label_centered(gui, "Place textbox");

View file

@ -17,7 +17,6 @@ DrawingProgramToolType ZoomCanvasTool::get_type() {
}
void ZoomCanvasTool::gui_toolbox() {
Toolbar& t = drawP.world.main.toolbar;
auto& gui = drawP.world.main.g.gui;
gui.new_id("Zoom canvas tool", [&] {
GUIStuff::ElementHelpers::text_label_centered(gui, "Zoom tool");