changeset 923:9c27d6594b19

Fixed line width for element S (strike through)
author corvid <corvid@lavabit.com>
date Sun, 08 Feb 2009 18:13:30 -0300
parents 40bc2df4de7a
children 7fbcb380ee4d
files dw/textblock.cc
diffstat 1 files changed, 21 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/dw/textblock.cc	Sun Feb 08 16:58:29 2009 -0300
+++ b/dw/textblock.cc	Sun Feb 08 18:13:30 2009 -0300
@@ -1299,20 +1299,22 @@
          /* strike-through */
          if (word->style->textDecoration
              & core::style::TEXT_DECORATION_LINE_THROUGH)
-            view->drawLine (color, core::style::Color::SHADING_NORMAL,
-                            xWorld,
-                            yWorldBase - word->size.ascent / 2 + diff,
-                            xWorld + word->size.width - 1,
-                            yWorldBase - word->size.ascent / 2 + diff);
+            view->drawRectangle (
+               color, core::style::Color::SHADING_NORMAL,
+               true, xWorld,
+               yWorldBase + (diff + word->size.descent - word->size.ascent)/2,
+               word->size.width,
+               1 + word->style->font->xHeight / 10);
          if (wordIndex + 1 < line->lastWord &&
              (word->spaceStyle->textDecoration
               & core::style::TEXT_DECORATION_LINE_THROUGH))
-            view->drawLine (word->spaceStyle->color,
-                            core::style::Color::SHADING_NORMAL,
-                            xWorld + word->size.width,
-                            yWorldBase - word->size.ascent / 2 + diff,
-                            xWorld + word->size.width + word->effSpace - 1,
-                            yWorldBase - word->size.ascent / 2 + diff);
+            view->drawRectangle (
+               word->spaceStyle->color,
+               core::style::Color::SHADING_NORMAL,
+               true, xWorld + word->size.width,
+               yWorldBase + (diff + word->size.descent - word->size.ascent)/2,
+               word->effSpace,
+               1 + word->style->font->xHeight / 10);
 
          for (layer = 0; layer < core::HIGHLIGHT_NUM_LAYERS; layer++) {
             if (hlStart[layer].index <= wordIndex &&
@@ -1373,13 +1375,14 @@
                                      yWorldBase + 1 + diff);
                   if (word->style->textDecoration
                       & core::style::TEXT_DECORATION_LINE_THROUGH)
-                     view->drawLine (color,
-                                     core::style::Color::SHADING_INVERSE,
-                                     startHL,
-                                     yWorldBase - word->size.ascent / 2 + diff,
-                                     startHL + widthHL - 1,
-                                     yWorldBase - word->size.ascent / 2
-                                     + diff);
+                     view->drawRectangle (
+                        color,
+                        core::style::Color::SHADING_INVERSE,
+                        true, startHL,
+                        yWorldBase + (diff + word->size.descent -
+                                      word->size.ascent) / 2,
+                        widthHL,
+                        1 + word->style->font->xHeight / 10);
                }
             }
          }