changeset 1656:0b01d120294c

use line height when drawing space background as well Using line height for this and the earlier Word change seems to make the appearance closer to firefox's. Of course, I'm sure there will be counterexamples...
author corvid <corvid@lavabit.com>
date Wed, 21 Apr 2010 17:24:15 +0000
parents 3e01d83fd6d1
children 3c63fb1f08b3
files dw/textblock.cc
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/dw/textblock.cc	Wed Apr 21 03:46:20 2010 +0000
+++ b/dw/textblock.cc	Wed Apr 21 17:24:15 2010 +0000
@@ -1344,12 +1344,6 @@
          spaceBgColor, core::style::Color::SHADING_INVERSE, true, xWorld,
          yWorldBase - style->font->ascent, word->effSpace,
          style->font->ascent + style->font->descent);
-   } else {
-      /* Draw space background (color, image), when given. */
-      if (style->hasBackground ())
-         drawBox (
-            view, style, area, xWidget, yWidgetBase - style->font->ascent,
-            word->effSpace, style->font->ascent + style->font->descent, false);
    }
    if (style->textDecoration) {
       core::style::Color::Shading shading = highlight ?
@@ -1407,6 +1401,11 @@
             if (word->effSpace > 0 && wordIndex < line->lastWord &&
                 words->getRef(wordIndex + 1)->content.type !=
                                                         core::Content::BREAK) {
+               if (word->spaceStyle->hasBackground ())
+                  drawBox (view, word->spaceStyle, area,
+                           xWidget + word->size.width,
+                           yWidgetBase - line->boxAscent, word->effSpace,
+                           line->boxAscent + line->boxDescent, false);
                drawSpace(wordIndex, view, area, xWidget + word->size.width,
                          yWidgetBase);
             }