Drop Down List: minor code simplification
This commit is contained in:
parent
632c867144
commit
098f1a15aa
1 changed files with 2 additions and 1 deletions
|
@ -25,6 +25,7 @@
|
|||
#include "gui/widgets/toggle_panel.hpp"
|
||||
#include "gui/widgets/window.hpp"
|
||||
|
||||
#include "sdl/rect.hpp"
|
||||
#include "utils/functional.hpp"
|
||||
|
||||
namespace gui2
|
||||
|
@ -55,7 +56,7 @@ namespace {
|
|||
}
|
||||
|
||||
SDL_Rect rect = window.get_rectangle();
|
||||
if(coordinate.x < rect.x || coordinate.x > rect.x + rect.w || coordinate.y < rect.y || coordinate.y > rect.y + rect.h ) {
|
||||
if(!sdl::point_in_rect(coordinate, rect)) {
|
||||
window.set_retval(twindow::CANCEL);
|
||||
} else {
|
||||
window.set_retval(twindow::OK);
|
||||
|
|
Loading…
Add table
Reference in a new issue