Drag selection working again - not much progress

This commit is contained in:
Sebastian
2024-11-18 01:57:10 +01:00
parent e9633ff19d
commit 22842f9deb
6 changed files with 28 additions and 41 deletions
+2 -3
View File
@@ -33,8 +33,7 @@ namespace VISEQ::APP::CANVAS {
EndMode2D();
}
void select_rect(){
void selectNodes(){
if(state->mouse_left.clicked){
state->selection = (Rectangle){0,0,0,0};
select_start = state->screen_mouse;
@@ -55,7 +54,7 @@ namespace VISEQ::APP::CANVAS {
virtual void update() override {
camera_delta = state->mouse_delta * (-1.0f/camera.zoom);
if(hovering()) drag();
if(state->istate == InteractionState::HOVER_CANVAS || state->istate == InteractionState::DRAW_SELECTION) select_rect();
if(state->istate == InteractionState::HOVER_CANVAS || state->istate == InteractionState::DRAW_SELECTION) selectNodes();
float wheel = GetMouseWheelMove();
if(wheel != 0){