summaryrefslogtreecommitdiff
path: root/dw/textblock.cc
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2010-09-29 15:29:34 -0400
committerJorge Arellano Cid <jcid@dillo.org>2010-09-29 15:29:34 -0400
commit43bba3831700cf45fab30c913e6af38a4e67d9ef (patch)
tree873b58f1d56d490b4d579867004b3687ad47693e /dw/textblock.cc
parent5f6e7f9bfeb89cda7e1956958a44804179594d26 (diff)
Adjusted thickness for {under/over}line, and height for strike
Diffstat (limited to 'dw/textblock.cc')
-rw-r--r--dw/textblock.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 4c02287c..81fbcb69 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -1218,20 +1218,20 @@ void Textblock::decorateText(core::View *view, core::style::Style *style,
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);
}
}