tmf.ui: only start zooming if we are in the time graph area of a time graph.
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Mon, 15 Feb 2016 19:48:10 +0000 (14:48 -0500)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Tue, 16 Feb 2016 02:04:09 +0000 (21:04 -0500)
Ignore zoom operations in the "namespace" area.

Change-Id: Ib9398cce255112a598e02e8e3c01002b10548c61
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/66650
Reviewed-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java

index 78cae3833ea35ab666a96083ecbf428b5d32072c..322eeb2d05a3e651ba08dfd8fde67c08c17afc91 100644 (file)
@@ -2618,15 +2618,17 @@ public class TimeGraphControl extends TimeGraphBaseControl
                 updateCursor(e.x, e.stateMask);
             }
         } else if (3 == e.button) {
-            setCapture(true);
-            fDragX = Math.min(Math.max(e.x, fTimeProvider.getNameSpace()), getSize().x - RIGHT_MARGIN);
-            fDragX0 = fDragX;
-            fDragTime0 = getTimeAtX(fDragX0);
-            fDragState = DRAG_ZOOM;
-            fDragButton = e.button;
-            redraw();
-            updateCursor(e.x, e.stateMask);
-            fTimeGraphScale.setDragRange(fDragX0, fDragX);
+            if (e.x >= fTimeProvider.getNameSpace()) {
+                setCapture(true);
+                fDragX = Math.min(Math.max(e.x, fTimeProvider.getNameSpace()), getSize().x - RIGHT_MARGIN);
+                fDragX0 = fDragX;
+                fDragTime0 = getTimeAtX(fDragX0);
+                fDragState = DRAG_ZOOM;
+                fDragButton = e.button;
+                redraw();
+                updateCursor(e.x, e.stateMask);
+                fTimeGraphScale.setDragRange(fDragX0, fDragX);
+            }
         }
     }
 
This page took 0.027825 seconds and 5 git commands to generate.