tmf.xml: Fix xml timegraph resolution
authorJean-Christian Kouame <jean-christian.kouame@ericsson.com>
Fri, 16 Dec 2016 21:03:26 +0000 (16:03 -0500)
committerJean-Christian Kouame <jean-christian.kouame@ericsson.com>
Mon, 19 Dec 2016 20:06:25 +0000 (15:06 -0500)
When the window range is less than the display width, the resolution was
then equal to 0. The time event was not shown until the user change the
zoom level. Now we set the resolution value to 1 instead of 0.

Change-Id: I4f0ae39576c452f0bdfbaf23b836f3af758f0b91
Signed-off-by: Jean-Christian Kouame <jean-christian.kouame@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/87339
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui/src/org/eclipse/tracecompass/internal/tmf/analysis/xml/ui/views/timegraph/XmlTimeGraphView.java

index 1324fbdb2f31c85337f722591a7dc812b943b9d3..cffeaf1f6f839540ee04eb6b42eff84ee052c7ec 100644 (file)
@@ -437,7 +437,7 @@ public class XmlTimeGraphView extends AbstractTimeGraphView {
     }
 
     private void buildStatusEvent(XmlEntry traceEntry, @NonNull IProgressMonitor monitor, long start, long end) {
-        long resolution = (end - start) / getDisplayWidth();
+        long resolution = Math.max((end - start) / getDisplayWidth(), 1);
         long startTime = Math.max(start, traceEntry.getStartTime());
         long endTime = Math.min(end + 1, traceEntry.getEndTime());
         List<ITimeEvent> eventList = getEventList(traceEntry, startTime, endTime, resolution, monitor);
This page took 0.026399 seconds and 5 git commands to generate.