Drag selection and snap to grid ok. Deselect not working though...
This commit is contained in:
+17
-11
@@ -36,26 +36,32 @@ namespace VISEQ::BASE {
|
||||
picked_up = true;
|
||||
drag_offset = position - SCREEN_MOUSE;
|
||||
}
|
||||
|
||||
virtual void pickUp(Vec2Df selection_origin) override {
|
||||
picked_up = true;
|
||||
drag_offset = position - selection_origin;
|
||||
}
|
||||
|
||||
virtual void drag() override {
|
||||
state->selection_origin = position;
|
||||
if(KEYS_PRESSED.ctrl){
|
||||
selection_offset = position - state->selection_origin;
|
||||
}
|
||||
if(KEYS_DOWN.ctrl){
|
||||
position = MOD_MOUSE + selection_offset;
|
||||
} else {
|
||||
// state->selection_origin = position;
|
||||
/*if(KEYS_PRESSED.ctrl){*/
|
||||
/* selection_offset = position - state->selection_origin;*/
|
||||
/*}*/
|
||||
/*if(KEYS_DOWN.ctrl){*/
|
||||
/* position = MOD_MOUSE + selection_offset;*/
|
||||
/*} else {*/
|
||||
position = MOD_MOUSE + drag_offset;
|
||||
}
|
||||
/*}*/
|
||||
}
|
||||
|
||||
virtual void putDown() override {
|
||||
picked_up = false;
|
||||
}
|
||||
|
||||
virtual void select() override {
|
||||
in_selection_rect = CheckCollisionPointRec(position, state->selection);
|
||||
if(MOUSE_LEFT.released) selected = (KEYS_DOWN.shift && selected) || in_selection_rect;
|
||||
virtual bool select() override {
|
||||
/*in_selection_rect = */
|
||||
/*if(MOUSE_LEFT.released) selected = (KEYS_DOWN.shift && selected) || in_selection_rect;*/
|
||||
return CheckCollisionPointRec(position, state->selection);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user