mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 16:20:11 -04:00
gtk-stats: Fix mouse motion detected outside strip chart graph area
Cherry-picked from 3a38543f65670b2d754838c5b08a556df1485a01
This commit is contained in:
parent
bc6502a8fe
commit
be2e07637f
@ -402,6 +402,7 @@ set_drag_mode(GtkStatsGraph::DragMode drag_mode) {
|
|||||||
gboolean GtkStatsStripChart::
|
gboolean GtkStatsStripChart::
|
||||||
handle_button_press(GtkWidget *widget, int graph_x, int graph_y,
|
handle_button_press(GtkWidget *widget, int graph_x, int graph_y,
|
||||||
bool double_click) {
|
bool double_click) {
|
||||||
|
if (graph_x >= 0 && graph_y >= 0 && graph_x < get_xsize() && graph_y < get_ysize()) {
|
||||||
if (double_click) {
|
if (double_click) {
|
||||||
// Double-clicking on a color bar in the graph is the same as double-
|
// Double-clicking on a color bar in the graph is the same as double-
|
||||||
// clicking on the corresponding label.
|
// clicking on the corresponding label.
|
||||||
@ -414,8 +415,10 @@ handle_button_press(GtkWidget *widget, int graph_x, int graph_y,
|
|||||||
_drag_scale_start = pixel_to_height(graph_y);
|
_drag_scale_start = pixel_to_height(graph_y);
|
||||||
// SetCapture(_graph_window);
|
// SetCapture(_graph_window);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else if (_potential_drag_mode == DM_guide_bar && _drag_guide_bar >= 0) {
|
if (_potential_drag_mode == DM_guide_bar && _drag_guide_bar >= 0) {
|
||||||
set_drag_mode(DM_guide_bar);
|
set_drag_mode(DM_guide_bar);
|
||||||
_drag_start_y = graph_y;
|
_drag_start_y = graph_y;
|
||||||
// SetCapture(_graph_window);
|
// SetCapture(_graph_window);
|
||||||
@ -455,7 +458,8 @@ handle_button_release(GtkWidget *widget, int graph_x, int graph_y) {
|
|||||||
*/
|
*/
|
||||||
gboolean GtkStatsStripChart::
|
gboolean GtkStatsStripChart::
|
||||||
handle_motion(GtkWidget *widget, int graph_x, int graph_y) {
|
handle_motion(GtkWidget *widget, int graph_x, int graph_y) {
|
||||||
if (_drag_mode == DM_none && _potential_drag_mode == DM_none) {
|
if (_drag_mode == DM_none && _potential_drag_mode == DM_none &&
|
||||||
|
graph_x >= 0 && graph_y >= 0 && graph_x < get_xsize() && graph_y < get_ysize()) {
|
||||||
// When the mouse is over a color bar, highlight it.
|
// When the mouse is over a color bar, highlight it.
|
||||||
_label_stack.highlight_label(get_collector_under_pixel(graph_x, graph_y));
|
_label_stack.highlight_label(get_collector_under_pixel(graph_x, graph_y));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user