mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-12-05 09:21:57 +08:00
Easier to read HandleSelection
This commit is contained in:
parent
d38f3d229a
commit
46f7fbb8dc
@ -837,7 +837,7 @@ bool ScreenInteractive::HandleSelection(Event event) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mouse.motion == Mouse::Pressed) {
|
if(mouse.motion == Mouse::Pressed) {
|
||||||
selection_pending_ = CaptureMouse();
|
selection_pending_ = CaptureMouse();
|
||||||
if (!selection_pending_) {
|
if (!selection_pending_) {
|
||||||
return false;
|
return false;
|
||||||
@ -849,25 +849,19 @@ bool ScreenInteractive::HandleSelection(Event event) {
|
|||||||
selection_box_.y_max = mouse.y;
|
selection_box_.y_max = mouse.y;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if((mouse.motion == Mouse::Moved) && (selection_pending_)) {
|
||||||
if (!selection_pending_) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mouse.motion == Mouse::Moved) {
|
|
||||||
selection_box_.x_max = mouse.x;
|
selection_box_.x_max = mouse.x;
|
||||||
selection_box_.y_max = mouse.y;
|
selection_box_.y_max = mouse.y;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if((mouse.motion == Mouse::Released) && (selection_pending_)) {
|
||||||
if (mouse.motion != Mouse::Released) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
selection_box_.x_max = mouse.x;
|
selection_box_.x_max = mouse.x;
|
||||||
selection_box_.y_max = mouse.y;
|
selection_box_.y_max = mouse.y;
|
||||||
selection_pending_ = nullptr;
|
selection_pending_ = nullptr;
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// private
|
// private
|
||||||
|
Loading…
Reference in New Issue
Block a user