summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2005-10-20 22:05:33 +0000
committerFelipe Heidrich <fheidric>2005-10-20 22:05:33 +0000
commit6a813c0617ac8488370f9ff20aedd26c6cadafff (patch)
treea519484eeb12494960519525151e4d1bd330f011
parentf4cf3d6e03683b2a6cdbd10adda0fba73e537e38 (diff)
downloadeclipse.platform.swt-6a813c0617ac8488370f9ff20aedd26c6cadafff.tar.gz
eclipse.platform.swt-6a813c0617ac8488370f9ff20aedd26c6cadafff.tar.xz
eclipse.platform.swt-6a813c0617ac8488370f9ff20aedd26c6cadafff.zip
fixing underline+strikeout with rise
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
index bd5e794f63..7e16ae3ea1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
@@ -609,12 +609,12 @@ public void draw (GC gc, int x, int y, int selectionStart, int selectionEnd, Col
int newPen = hasSelection && fg == selectionForeground.handle ? selPen : OS.CreatePen(OS.BS_SOLID, 1, fg);
int oldPen = OS.SelectObject(hdc, newPen);
if (run.style.underline) {
- int underlineY = drawY + baseline + 1;
+ int underlineY = drawY + baseline + 1 - run.style.rise;
OS.MoveToEx(hdc, drawX, underlineY, 0);
OS.LineTo(hdc, drawX + run.width, underlineY);
}
if (run.style.strikeout) {
- int strikeoutY = drawRunY + run.leading + run.ascent / 2;
+ int strikeoutY = drawRunY + run.leading + (run.ascent - run.style.rise) / 2;
OS.MoveToEx(hdc, drawX, strikeoutY, 0);
OS.LineTo(hdc, drawX + run.width, strikeoutY);
}
@@ -642,12 +642,12 @@ public void draw (GC gc, int x, int y, int selectionStart, int selectionEnd, Col
if ((run.style != null) && (run.style.underline || run.style.strikeout)) {
int oldPen = OS.SelectObject(hdc, selPen);
if (run.style.underline) {
- int underlineY = drawY + baseline + 1;
+ int underlineY = drawY + baseline + 1 - run.style.rise;
OS.MoveToEx(hdc, rect.left, underlineY, 0);
OS.LineTo(hdc, rect.right, underlineY);
}
if (run.style.strikeout) {
- int strikeoutY = drawRunY + run.leading + run.ascent / 2;
+ int strikeoutY = drawRunY + run.leading + (run.ascent - run.style.rise) / 2;
OS.MoveToEx(hdc, rect.left, strikeoutY, 0);
OS.LineTo(hdc, rect.right, strikeoutY);
}