mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 11:28:17 -04:00
region that appears under mouse while mouse button is held down should become available
This commit is contained in:
parent
8f44b168e4
commit
64bb9dc4c0
@ -343,29 +343,29 @@ set_current_regions(MouseWatcher::VRegions ®ions) {
|
|||||||
new_region->within(param);
|
new_region->within(param);
|
||||||
throw_event_pattern(_within_pattern, new_region, ButtonHandle::none());
|
throw_event_pattern(_within_pattern, new_region, ButtonHandle::none());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Determine which is the "preferred region", if any. This is the
|
// Determine which is the "preferred region", if any. This is the
|
||||||
// topmost region that the mouse cursor is over, and the one that
|
// topmost region that the mouse cursor is over, and the one that
|
||||||
// we are considered "entered" into.
|
// we are considered "entered" into.
|
||||||
MouseWatcherRegion *new_preferred_region =
|
MouseWatcherRegion *new_preferred_region =
|
||||||
get_preferred_region(_current_regions);
|
get_preferred_region(_current_regions);
|
||||||
|
|
||||||
if (_button_down && new_preferred_region != _preferred_button_down_region) {
|
if (_button_down && new_preferred_region != _preferred_button_down_region) {
|
||||||
// If the button's being held down, we're only allowed to select
|
// If the button's being held down, we're only allowed to select
|
||||||
// the preferred button down region.
|
// the preferred button down region.
|
||||||
new_preferred_region = (MouseWatcherRegion *)NULL;
|
new_preferred_region = (MouseWatcherRegion *)NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (new_preferred_region != _preferred_region) {
|
||||||
|
if (_preferred_region != (MouseWatcherRegion *)NULL) {
|
||||||
|
_preferred_region->exit(param);
|
||||||
|
throw_event_pattern(_leave_pattern, _preferred_region, ButtonHandle::none());
|
||||||
}
|
}
|
||||||
|
_preferred_region = new_preferred_region;
|
||||||
if (new_preferred_region != _preferred_region) {
|
if (_preferred_region != (MouseWatcherRegion *)NULL) {
|
||||||
if (_preferred_region != (MouseWatcherRegion *)NULL) {
|
_preferred_region->enter(param);
|
||||||
_preferred_region->exit(param);
|
throw_event_pattern(_enter_pattern, _preferred_region, ButtonHandle::none());
|
||||||
throw_event_pattern(_leave_pattern, _preferred_region, ButtonHandle::none());
|
|
||||||
}
|
|
||||||
_preferred_region = new_preferred_region;
|
|
||||||
if (_preferred_region != (MouseWatcherRegion *)NULL) {
|
|
||||||
_preferred_region->enter(param);
|
|
||||||
throw_event_pattern(_enter_pattern, _preferred_region, ButtonHandle::none());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user