tmf: Fix incorrect zoom thread time bounds when time graph view is empty
authorPatrick Tasse <patrick.tasse@gmail.com>
Wed, 13 Jul 2016 19:56:55 +0000 (15:56 -0400)
committerPatrick Tasse <patrick.tasse@gmail.com>
Mon, 18 Jul 2016 14:31:32 +0000 (10:31 -0400)
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 <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/77279
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Jean-Christian Kouame <jean-christian.kouame@ericsson.com>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java

index 6b0650fd7374444d5412152f3829b083f9854c69..84d656dc9caacb3db2284c35d625c8ec23ab3a35 100644 (file)
@@ -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) {
This page took 0.02614 seconds and 5 git commands to generate.