From 6b4f40e909e75e23895e96900939a9c56a7912d6 Mon Sep 17 00:00:00 2001 From: William Bourque Date: Tue, 16 Mar 2010 21:10:34 +0000 Subject: [PATCH] Fix small UI bug in Control Flow View due to itemHeight != (bound / nbItem) --- .../widgets/TmfTimeStatesCtrl.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/timeAnalysis/widgets/TmfTimeStatesCtrl.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/timeAnalysis/widgets/TmfTimeStatesCtrl.java index c15e49ff33..afab6b8297 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/timeAnalysis/widgets/TmfTimeStatesCtrl.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/timeAnalysis/widgets/TmfTimeStatesCtrl.java @@ -871,6 +871,25 @@ public class TmfTimeStatesCtrl extends TraceCtrl implements FocusListener, Object[] items = _data._items; for (int i = _topItem; i < items.length; i++) { Item item = (Item) items[i]; + + // *** FIXME *** + // Everything in this file should be redone with comments. + // How the hell am I suppose to understand anything in here? + + // *** HACK *** + // The drawing of the rectangle can be wrong on some system. + // _itemHeight can be slightly smaller than the height space for the table (bound.height / items.length) + // This would cause the rectangle to slowly "slide" and to no longer get aligned with their text. + // + // ...There is probably a reason WHY the height space is different in the first hand + // but this code is a total mess, does not have any comments and is globally impossible to read/understand the way it is right now. + // + // For now, this little fix should do it... I hope. + int newItemHeight = (bound.height / items.length); + if ( newItemHeight > _itemHeight ) { + _itemHeight = newItemHeight; + } + getNameRect(_rect0, bound, i, nameWidth); if (_rect0.y >= bound.y + bound.height) break; -- 2.34.1