diff options
author | Felipe Heidrich <fheidric> | 2006-03-16 21:57:25 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2006-03-16 21:57:25 +0000 |
commit | b5d3c82373a130ee58125864784553ac1c1a11da (patch) | |
tree | 983a81502eb0689ac07fc7be5c904ba3f93983dc | |
parent | 2957b637f2f9d3bf81ed31fe6c15d970da203319 (diff) | |
download | eclipse.platform.swt-b5d3c82373a130ee58125864784553ac1c1a11da.tar.gz eclipse.platform.swt-b5d3c82373a130ee58125864784553ac1c1a11da.tar.xz eclipse.platform.swt-b5d3c82373a130ee58125864784553ac1c1a11da.zip |
Bug 131906
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java index 3f66e35d8f..04f29ac5ea 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java @@ -862,9 +862,18 @@ TextLayout getTextLayout(int lineIndex, int orientation, int width, int lineSpac } if (lastOffset < length) layout.setStyle(null, lastOffset, length); if (styledText.isFixedLineHeight()) { - int height = layout.getBounds().height; - if (height > getLineHeight()) { - FontMetrics metrics = layout.getLineMetrics(0); + int index = -1; + int lineCount = layout.getLineCount(); + int height = getLineHeight(); + for (int i = 0; i < lineCount; i++) { + int lineHeight = layout.getLineBounds(i).height; + if (lineHeight > height) { + height = lineHeight; + index = i; + } + } + if (index != -1) { + FontMetrics metrics = layout.getLineMetrics(index); ascent = metrics.getAscent() + metrics.getLeading(); descent = metrics.getDescent(); if (layouts != null) { |