diff --git a/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java b/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java index f63a54c6c1d..87f2127f7f0 100644 --- a/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java +++ b/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java @@ -14,6 +14,7 @@ package org.eclipse.jface.text.source; + import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.PaintEvent; import org.eclipse.swt.events.PaintListener; @@ -262,12 +263,12 @@ private void draw(final GC gc, final int offset) { // determine the character width separately, because the getTextBounds above // will also include any in-line annotations (e.g. codemining annotations) in the width final String matchingCharacter= fTextWidget.getText(offset, offset); - final int width= gc.textExtent(matchingCharacter).x; + final Point sizePoints= gc.textExtent(matchingCharacter); - final int height= fTextWidget.getCaret().getSize().y; + Rectangle rectangleOfFloat= Rectangle.of(new Point(bounds.x, bounds.y), sizePoints); // draw box around line segment - gc.drawRectangle(bounds.x, bounds.y + bounds.height - height, width, height - 1); + gc.drawRectangle(rectangleOfFloat); } else { fTextWidget.redrawRange(offset, 1, true); } @@ -473,4 +474,4 @@ private boolean searchForCharacters(String text, ICharacterPairMatcherExtension return false; } } -} +} \ No newline at end of file