Skip to content

Commit

Permalink
tmf: Remove workaround for font height in TimeGraphControl.drawMarker()
Browse files Browse the repository at this point in the history
With the font now matching the requested height, the workaround for the
marker symbol text y-position can be removed.

Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
  • Loading branch information
PatrickTasse committed May 3, 2024
1 parent 32cb6dc commit 242120e
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*****************************************************************************
* Copyright (c) 2007, 2022 Intel Corporation and others
* Copyright (c) 2007, 2024 Intel Corporation and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -2342,13 +2342,7 @@ protected void drawMarker(IMarkerEvent marker, Rectangle bounds, ITimeDataProvid
gc.setForeground(color);
int height = (int) (rect.height * heightFactor);
TimeGraphRender.setFontForHeight(height, gc);
int textSize = (gc.textExtent(symbol).y + 1) / 2;
if (VerticalAlign.BOTTOM.equals(verticalAlign)) {
y = rect.y + rect.height / 2 + Math.max(0, rect.height / 2 - textSize);
} else if (VerticalAlign.TOP.equals(verticalAlign)) {
y = rect.y + rect.height / 2 - Math.max(0, rect.height / 2 - textSize);
}
gc.drawText(symbol, rect.x - symbolSize, y - textSize, true);
gc.drawText(symbol, rect.x - symbolSize, y - symbolSize, true);
gc.setForeground(oldColor);
}
gc.setAlpha(OPAQUE);
Expand Down

0 comments on commit 242120e

Please sign in to comment.