2025-07-06 20:43:53 +03:00
|
|
|
#pragma once
|
|
|
|
|
#include <include/core/SkCanvas.h>
|
|
|
|
|
#include "../DrawData.hpp"
|
|
|
|
|
#include <Helpers/SCollision.hpp>
|
|
|
|
|
#include "../CoordSpaceHelper.hpp"
|
|
|
|
|
#include "../DrawComponents/DrawComponent.hpp"
|
|
|
|
|
|
|
|
|
|
class DrawingProgram;
|
|
|
|
|
|
|
|
|
|
class RectSelectTool {
|
|
|
|
|
public:
|
|
|
|
|
RectSelectTool(DrawingProgram& initDrawP);
|
|
|
|
|
void gui_toolbox();
|
|
|
|
|
void tool_update();
|
|
|
|
|
void draw(SkCanvas* canvas, const DrawData& drawData);
|
|
|
|
|
void reset_tool();
|
|
|
|
|
private:
|
|
|
|
|
struct RectSelectControls {
|
|
|
|
|
int selectionMode = 0;
|
|
|
|
|
|
|
|
|
|
|
2025-07-24 16:35:48 +03:00
|
|
|
CoordSpaceHelper coords;
|
2025-07-06 20:43:53 +03:00
|
|
|
|
2025-07-24 16:35:48 +03:00
|
|
|
Vector2f selectStartAt;
|
2025-07-06 20:43:53 +03:00
|
|
|
|
2025-07-24 16:35:48 +03:00
|
|
|
std::array<Vector2f, 4> newT;
|
2025-07-06 20:43:53 +03:00
|
|
|
} controls;
|
|
|
|
|
|
|
|
|
|
DrawingProgram& drawP;
|
|
|
|
|
};
|