All tools now converted to use new net objects

This commit is contained in:
Yousef Khadadeh 2025-12-15 15:36:42 +03:00
parent 45ba26446a
commit 7d1671229b
62 changed files with 492 additions and 481 deletions

View file

@ -1,8 +1,7 @@
#pragma once
#include "../DrawComponents/DrawTextBox.hpp"
#include "DrawingProgramToolBase.hpp"
#include <Helpers/SCollision.hpp>
#include <any>
#include "../CanvasComponents/CanvasComponentContainer.hpp"
class DrawingProgram;
@ -12,19 +11,16 @@ class TextBoxTool : public DrawingProgramToolBase {
virtual DrawingProgramToolType get_type() override;
virtual void gui_toolbox() override;
virtual bool right_click_popup_gui(Vector2f popupPos) override;
virtual void erase_component(const CanvasComponentContainer::ObjInfoSharedPtr& 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;
private:
void edit_text(std::function<void()> toRun, const std::shared_ptr<DrawTextBox>& textBox);
void update_textbox_network(const std::shared_ptr<DrawTextBox>& textBox);
void commit();
struct TextBoxControls {
Vector2f startAt;
Vector2f endAt;
int drawStage = 0;
std::shared_ptr<DrawTextBox> intermediateItem;
} controls;
Vector2f startAt;
Vector2f endAt;
int drawStage = 0;
CanvasComponentContainer::ObjInfoSharedPtr objInfoBeingEdited;
};