summaryrefslogtreecommitdiff
path: root/dw/textblock.cc
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2010-04-21 17:24:15 +0000
committercorvid <corvid@lavabit.com>2010-04-21 17:24:15 +0000
commitd20fe82191d472b3073b793aee4508323a95b075 (patch)
tree496d75cab7a4473a313de6eb63074df439517005 /dw/textblock.cc
parentbe6a1b63cc3b6f8264e2e99412597dc63e9553c5 (diff)
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...
Diffstat (limited to 'dw/textblock.cc')
-rw-r--r--dw/textblock.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 4b4d0c08..d22b9726 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -1344,12 +1344,6 @@ void Textblock::drawSpace(int wordIndex, core::View *view,
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 @@ void Textblock::drawLine (Line *line, core::View *view, core::Rectangle *area)
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);
}