Dragging and selecting works. Dragging the selection not yet.

This commit is contained in:
Sebastian
2024-11-25 00:53:10 +01:00
parent f04838bffa
commit 9c0aac8618
9 changed files with 76 additions and 53 deletions
+9 -3
View File
@@ -3,8 +3,10 @@
#include "clipboard.h"
#include "datatypes.h"
#include "graph-manager.h"
#include "interaction-event.h"
#include "midi-node.h"
#include "mouse.h"
#include "moveable.h"
#include "node.h"
#include "raylib.h"
#include "signal-manager.h"
@@ -61,16 +63,18 @@ namespace VISEQ::APP {
auto e = event_queue.front();
std::cout << e.action << " " << e.item->z_index << std::endl;
if(e.item->getType() == GraphItemType::NODE || e.item->getType() == GraphItemType::CONNECTOR) {
if(e.item->getType() == GraphItemType::NODE || e.item->getType() == GraphItemType::CONNECTOR || e.item->getType() == GraphItemType::CANVAS) {
switch(e.action){
case VISEQ::APP::Interaction::PICKUP:
{
e.item->pickUp();
goto exit_loop;
break;
}
case VISEQ::APP::Interaction::DRAG:
{
e.item->drag();
goto exit_loop;
break;
}
case VISEQ::APP::Interaction::PUTDOWN:
@@ -78,11 +82,13 @@ namespace VISEQ::APP {
e.item->putDown();
break;
}
default:
}
}
event_queue.pop();
event_queue.pop_front();
}
exit_loop:
event_queue.clear();
}
void update(){