summaryrefslogtreecommitdiff
path: root/dw/style.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2013-10-08 15:03:36 +0200
committerSebastian Geerken <devnull@localhost>2013-10-08 15:03:36 +0200
commitff920593c94fe192775811b7d9c7ab340a883c3a (patch)
tree6c5e1446c901aaf6e14bfbda95b5919bb0ab3c53 /dw/style.cc
parent770d42709c33d55cfd3d650efbb95abdc7c2cc65 (diff)
Cleaned up "reference area" of background images; confirms now to CSS spec.
Diffstat (limited to 'dw/style.cc')
-rw-r--r--dw/style.cc31
1 files changed, 5 insertions, 26 deletions
diff --git a/dw/style.cc b/dw/style.cc
index 721e6c81..cda61845 100644
--- a/dw/style.cc
+++ b/dw/style.cc
@@ -520,7 +520,7 @@ void StyleImage::ExternalImgRenderer::drawRow (int row)
int imgHeight = imgbuf->getRootHeight ();
int x, y, width, height;
- getPaddingArea (&x, &y, &width, &height);
+ getBgArea (&x, &y, &width, &height);
int xRef, yRef, widthRef, heightRef;
getRefArea (&xRef, &yRef, &widthRef, &heightRef);
@@ -557,23 +557,6 @@ void StyleImage::ExternalImgRenderer::drawRow (int row)
// ----------------------------------------------------------------------
-void StyleImage::ExternalWidgetImgRenderer::getPaddingArea (int *x, int *y,
- int *width,
- int *height)
-{
- Style *style = getStyle ();
- assert (style != NULL);
-
- int x0, y0, width0, height0;
- getArea (&x0, &y0, &width0, &height0);
- *x = x0 + style->margin.left + style->borderWidth.left;
- *y = y0 + style->margin.top + style->borderWidth.top;
- *width = width0 - style->margin.left - style->borderWidth.left
- - style->margin.right - style->borderWidth.right;
- *height = height0 - style->margin.top - style->borderWidth.top
- - style->margin.bottom - style->borderWidth.bottom;
-}
-
StyleImage *StyleImage::ExternalWidgetImgRenderer::getBackgroundImage ()
{
Style *style = getStyle ();
@@ -1096,14 +1079,10 @@ void drawBackground (View *view, Layout *layout, Rectangle *area,
if (bgColor || bgImage) {
Rectangle bgArea, intersection;
- bgArea.x = x + style->margin.left + style->borderWidth.left;
- bgArea.y = y + style->margin.top + style->borderWidth.top;
- bgArea.width =
- width - style->margin.left - style->borderWidth.left -
- style->margin.right - style->borderWidth.right;
- bgArea.height =
- height - style->margin.top - style->borderWidth.top -
- style->margin.bottom - style->borderWidth.bottom;
+ bgArea.x = x;
+ bgArea.y = y;
+ bgArea.width = width;
+ bgArea.height = height;
if (area->intersectsWith (&bgArea, &intersection)) {
if (bgColor)