changeset 1709:bb7a10e3e73a

Adjusted thickness for {under/over}line, and height for strike
author Jorge Arellano Cid <jcid@dillo.org>
date Wed, 29 Sep 2010 15:29:34 -0400
parents 4bf0cd96462b
children 18f974a1380c
files dw/textblock.cc
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/dw/textblock.cc	Mon Sep 27 16:35:47 2010 -0400
+++ b/dw/textblock.cc	Wed Sep 29 15:29:34 2010 -0400
@@ -1218,20 +1218,20 @@
                              core::style::Color::Shading shading,
                              int x, int yBase, int width)
 {
-   int y;
+   int y, height;
 
+   height = 1 + style->font->xHeight / 12;
    if (style->textDecoration & core::style::TEXT_DECORATION_UNDERLINE) {
-      y = yBase + 1;
-      view->drawLine (style->color, shading, x, y, x + width - 1, y);
+      y = yBase + style->font->descent / 3;
+      view->drawRectangle (style->color, shading, true, x, y, width, height);
    }
    if (style->textDecoration & core::style::TEXT_DECORATION_OVERLINE) {
-      y = yBase - style->font->ascent + 1;
-      view->drawLine (style->color, shading, x, y, x + width - 1, y);
+      y = yBase - style->font->ascent;
+      view->drawRectangle (style->color, shading, true, x, y, width, height);
    }
    if (style->textDecoration & core::style::TEXT_DECORATION_LINE_THROUGH) {
-      int height = 1 + style->font->xHeight / 10;
-
-      y = yBase + (style->font->descent - style->font->ascent) / 2;
+      y = yBase + (style->font->descent - style->font->ascent) / 2 +
+          style->font->descent / 4;
       view->drawRectangle (style->color, shading, true, x, y, width, height);
    }
 }