changeset 2085:7c04f8d91d24

widgets draw their own border and background Don't draw background for widgets in Textblock::drawLine(). This fixes the border_background_margin.html test in css_compat.
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Tue, 07 Jun 2011 12:09:20 +0200
parents 5b8e5855ab8e
children a82b8ba0eb8e
files dw/textblock.cc
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/dw/textblock.cc	Tue Jun 07 12:06:52 2011 +0200
+++ b/dw/textblock.cc	Tue Jun 07 12:09:20 2011 +0200
@@ -1403,11 +1403,6 @@
              word->content.type == core::Content::WIDGET) {
 
             if (word->size.width > 0) {
-               if (word->style->hasBackground ()) {
-                  drawBox (view, word->style, area, xWidget,
-                           yWidgetBase - line->boxAscent, word->size.width,
-                           line->boxAscent + line->boxDescent, false);
-               }
                if (word->content.type == core::Content::WIDGET) {
                   core::Widget *child = word->content.widget;
                   core::Rectangle childArea;
@@ -1415,6 +1410,11 @@
                   if (child->intersects (area, &childArea))
                      child->draw (view, &childArea);
                } else {
+                  if (word->style->hasBackground ()) {
+                     drawBox (view, word->style, area, xWidget,
+                              yWidgetBase - line->boxAscent, word->size.width,
+                              line->boxAscent + line->boxDescent, false);
+                  }
                   drawText(wordIndex, view, area, xWidget, yWidgetBase);
                }
             }