Introduction of mouse.h for z-index mouse events
This commit is contained in:
+5
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user