From f21626d2e9710911d2a057ce1d852deb13626b8c Mon Sep 17 00:00:00 2001 From: Patrick Tasse Date: Wed, 13 Jul 2016 15:56:55 -0400 Subject: [PATCH] tmf: Fix incorrect zoom thread time bounds when time graph view is empty When the time graph view is empty because none of its build threads have started yet, the time bounds still have the initial values set to [+INF, -INF]. If a zoom thread is started at that moment, the requested start and end time of the zoom thread are clamped to the time graph view's bounds and are consequently set to [-INF, +INF]. This is changed so that the zoom thread does not clamp the requested start and end time when the time graph view's bounds are not set. Change-Id: I6c751641dab8eb4d1389adabf89c3c5a614e6b90 Signed-off-by: Patrick Tasse Reviewed-on: https://git.eclipse.org/r/77279 Reviewed-by: Hudson CI Reviewed-by: Matthew Khouzam Tested-by: Jean-Christian Kouame --- .../tmf/ui/views/timegraph/AbstractTimeGraphView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java index 6b0650fd73..84d656dc9c 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java @@ -1958,8 +1958,8 @@ public abstract class AbstractTimeGraphView extends TmfView implements ITmfTimeA * @since 2.0 */ protected final void startZoomThread(long startTime, long endTime) { - long clampedStartTime = Math.min(Math.max(startTime, fStartTime), fEndTime); - long clampedEndTime = Math.max(Math.min(endTime, fEndTime), fStartTime); + long clampedStartTime = (fStartTime == Long.MAX_VALUE ? startTime : Math.min(Math.max(startTime, fStartTime), fEndTime)); + long clampedEndTime = (fEndTime == Long.MIN_VALUE ? endTime : Math.max(Math.min(endTime, fEndTime), fStartTime)); fDirty.incrementAndGet(); boolean restart = false; if (fZoomThread != null) { -- 2.34.1