From a8c25410f275a606a592a8d74b912b36eea2f8b3 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 13 Feb 2001 17:41:40 +0000 Subject: [PATCH] *** empty log message *** --- panda/src/tform/mouseWatcher.cxx | 22 ++++++++++++++++------ panda/src/tform/mouseWatcher.h | 1 + 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/panda/src/tform/mouseWatcher.cxx b/panda/src/tform/mouseWatcher.cxx index 35138b21e4..4fbb9a7178 100644 --- a/panda/src/tform/mouseWatcher.cxx +++ b/panda/src/tform/mouseWatcher.cxx @@ -20,6 +20,7 @@ TypeHandle MouseWatcher::_type_handle; TypeHandle MouseWatcher::_xyz_type; +TypeHandle MouseWatcher::_pixel_xyz_type; TypeHandle MouseWatcher::_button_events_type; //////////////////////////////////////////////////////////////////// @@ -282,19 +283,26 @@ transmit_data(NodeAttributes &data) { } } + bool suppress_below = false; + if (_button_down_region != (MouseWatcherRegion *)NULL) { // We're currently holding down a button. This is the effective // region that determines whether we suppress below. - if (_button_down_region->get_suppress_below()) { - data.clear(); - } + suppress_below = _button_down_region->get_suppress_below(); } else if (_current_region != (MouseWatcherRegion *)NULL) { // We're not holding down a button, but we are within a region. // Use this region to determine whether we suppress below. - if (_current_region->get_suppress_below()) { - data.clear(); - } + suppress_below = _current_region->get_suppress_below(); + } + + if (suppress_below) { + // We used to suppress *everything* below, but on reflection we + // really only want to suppress the mouse position information. + // Button events must still get through. + + data.clear_attribute(_xyz_type); + data.clear_attribute(_pixel_xyz_type); } } @@ -313,6 +321,8 @@ init_type() { Vec3DataTransition::init_type(); register_data_transition(_xyz_type, "XYZ", Vec3DataTransition::get_class_type()); + register_data_transition(_pixel_xyz_type, "PixelXYZ", + Vec3DataTransition::get_class_type()); ButtonEventDataTransition::init_type(); register_data_transition(_button_events_type, "ButtonEvents", ButtonEventDataTransition::get_class_type()); diff --git a/panda/src/tform/mouseWatcher.h b/panda/src/tform/mouseWatcher.h index 4f46afaeb3..fb7384d534 100644 --- a/panda/src/tform/mouseWatcher.h +++ b/panda/src/tform/mouseWatcher.h @@ -111,6 +111,7 @@ public: // inputs & outputs static TypeHandle _xyz_type; + static TypeHandle _pixel_xyz_type; static TypeHandle _button_events_type;