Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2016-02-21 17:29:27 +0000
committerAndrey Loskutov2016-03-14 18:55:03 +0000
commit9e768450f3dae80d6e47d4ad9904111f0494ca26 (patch)
tree7e3ca22b1541fdf8c5114df4af6b04219a563245 /org.eclipse.jface.text
parent84a6938a421aefbe5030d37f0d62f0cee502ad72 (diff)
downloadeclipse.platform.text-9e768450f3dae80d6e47d4ad9904111f0494ca26.tar.gz
eclipse.platform.text-9e768450f3dae80d6e47d4ad9904111f0494ca26.tar.xz
eclipse.platform.text-9e768450f3dae80d6e47d4ad9904111f0494ca26.zip
For client interested in *full real* text line height (including all wrapped line segments) replaced call to StyledText.getLineHeight(int) with new JFaceTextUtil.computeLineHeight() API. Change-Id: I7df34cb98f00051367fd6b4680d1ead3499f5549 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.jface.text')
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/source/DiffPainter.java19
1 files changed, 3 insertions, 16 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/source/DiffPainter.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/source/DiffPainter.java
index a615bbaf1cf..53c82fe958d 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/source/DiffPainter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/source/DiffPainter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2015 IBM Corporation and others.
+ * Copyright (c) 2006, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,6 @@ import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
@@ -222,20 +221,8 @@ public final class DiffPainter {
if (info != null) {
int y= fWidget.getLinePixel(widgetLine);
- boolean isWrapActive= fWidget.getWordWrap();
- int lineHeight;
- int offset= fWidget.getOffsetAtLine(widgetLine);
- if (!isWrapActive) {
- lineHeight= fWidget.getLineHeight(offset);
- } else {
- int offsetEnd= offset + fWidget.getLine(widgetLine).length();
- if (offsetEnd == fWidget.getCharCount()) {
- lineHeight= fWidget.getLineHeight(offset);
- } else {
- Rectangle textBounds= fWidget.getTextBounds(offset, offsetEnd);
- lineHeight= textBounds.height;
- }
- }
+ int lineHeight = JFaceTextUtil.computeLineHeight(fWidget, widgetLine);
+
// draw background color if special
if (hasSpecialColor(info)) {
gc.setBackground(getColor(info));

Back to the top