Can now add and remove from selection using shift and alt

This commit is contained in:
Yousef Khadadeh 2025-08-05 19:04:47 +03:00
parent 137b1603e5
commit 1a5815a994
12 changed files with 103 additions and 61 deletions

View file

@ -59,7 +59,7 @@ void RectDrawTool::tool_update() {
if(drawP.controls.leftClickHeld) {
controls.intermediateItem->lastUpdateTime = std::chrono::steady_clock::now();
Vector2f newPos = controls.intermediateItem->coords.get_mouse_pos(drawP.world);
if(drawP.world.main.input.key(InputManager::KEY_EQUAL_DIMENSIONS).held) {
if(drawP.world.main.input.key(InputManager::KEY_GENERIC_LSHIFT).held) {
float height = std::fabs(controls.startAt.y() - newPos.y());
newPos.x() = controls.startAt.x() + (((newPos.x() - controls.startAt.x()) < 0.0f ? -1.0f : 1.0f) * height);
}