Introduction of mouse.h for z-index mouse events

This commit is contained in:
Sebastian
2024-11-21 23:58:35 +01:00
parent bfc14d5f6e
commit a6b6ff1d16
8 changed files with 42 additions and 13 deletions
+5 -2
View File
@@ -56,7 +56,7 @@ namespace VISEQ::BASE {
virtual void update() override {
if(STATE != IState::HOVER_NODE) select();
if(hovering() && z_index > z_hovering) z_hovering = z_index;
if((pickedUp() || hovering()) && z_hovering == -1) z_hovering = z_index;
if(z_index == z_hovering || selected){
if(pickedUp()){
@@ -67,15 +67,18 @@ namespace VISEQ::BASE {
if(STATE != IState::DRAG_NODE){
if(entered()){
STATE = IState::HOVER_NODE;
std::cout << "z_index=" << z_index << " z_hovering=" << z_hovering << std::endl;
is_hovering = true;
}
if(exited()){
STATE = IState::HOVER_CANVAS;
is_hovering = false;
}
}
if(released() && picked_up){
std::cout << z_hovering << std::endl;
putDown();
STATE = IState::HOVER_CANVAS;
if(hovering()) STATE = IState::HOVER_NODE;
}
}
};