summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2008-01-28 00:58:31 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2008-01-28 00:58:31 +0000
commit49fce64c1a9a76e8ef9062e90932df3f55073508 (patch)
treefe75361b99017dd575f1aef41cf00a8ab2e286f5 /render
parent48bdeb34c87d2124ce0bfbd885e14b1bb1695ce2 (diff)
downloadnetsurf-49fce64c1a9a76e8ef9062e90932df3f55073508.tar.gz
netsurf-49fce64c1a9a76e8ef9062e90932df3f55073508.tar.bz2
Fix vertical position of images with margin/borders/padding.
svn path=/trunk/netsurf/; revision=3785
Diffstat (limited to 'render')
-rw-r--r--render/html_redraw.c6
-rw-r--r--render/layout.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/render/html_redraw.c b/render/html_redraw.c
index 52b33190a..6ad5f8c47 100644
--- a/render/html_redraw.c
+++ b/render/html_redraw.c
@@ -1305,6 +1305,12 @@ bool html_redraw_background(int x, int y, struct box *box, float scale,
if (plot_content) {
if (!plot.clip(clip_x0, clip_y0, clip_x1, clip_y1))
return false;
+ if ((repeat_x || repeat_y) && (!(repeat_x && repeat_y))) {
+ clip_x0 += ceilf(box->border[LEFT] * scale);
+ clip_x1 -= ceilf(box->border[RIGHT] * scale);
+ clip_y0 += ceilf(box->border[TOP] * scale);
+ clip_y1 -= ceilf(box->border[BOTTOM] * scale);
+ }
if (!content_redraw_tiled(background->background, x, y,
ceilf(background->background->width * scale),
ceilf(background->background->height * scale),
diff --git a/render/layout.c b/render/layout.c
index d00cf6af4..02374e755 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -1505,7 +1505,8 @@ bool layout_line(struct box *first, int *width, int *y,
d->x += x0;
d->y = *y - d->padding[TOP];
}
- if (d->type == BOX_INLINE_BLOCK) {
+ if ((d->type == BOX_INLINE && (d->object || d->gadget)) ||
+ d->type == BOX_INLINE_BLOCK) {
d->x += x0;
d->y = *y + d->border[TOP] + d->margin[TOP];
}