From 14b7dd60e6cc9e1d4a9c57a167ee63b4b546d189 Mon Sep 17 00:00:00 2001 From: Matthew Khouzam Date: Mon, 15 Feb 2016 14:48:10 -0500 Subject: [PATCH] tmf.ui: only start zooming if we are in the time graph area of a time graph. Ignore zoom operations in the "namespace" area. Change-Id: Ib9398cce255112a598e02e8e3c01002b10548c61 Signed-off-by: Matthew Khouzam Reviewed-on: https://git.eclipse.org/r/66650 Reviewed-by: Hudson CI Reviewed-by: Patrick Tasse Tested-by: Patrick Tasse --- .../timegraph/widgets/TimeGraphControl.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java index 78cae3833e..322eeb2d05 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java @@ -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); + } } } -- 2.34.1