Fix vertical position of images with margin/borders/padding.

svn path=/trunk/netsurf/; revision=3785
This commit is contained in:
Michael Drake 2008-01-28 00:58:31 +00:00
parent 48bdeb34c8
commit 49fce64c1a
4 changed files with 25 additions and 16 deletions

View File

@ -99,7 +99,7 @@ CDir <Wimp$ScrapDir>.WWW.NetSurf
| NB: trailing dot is required
FontInstall NetSurf:Resources.Fonts.
WimpSlot -min 2240k -max 2240k
WimpSlot -min 3540k -max 3540k
Run <NetSurf$Dir>.!RunImage -v %*0 2><Wimp$ScrapDir>.WWW.NetSurf.Log
| Uninstall NetSurf-specific fonts

View File

@ -72,8 +72,23 @@ OBJECTS_GTK += font_pango.o gtk_bitmap.o gtk_gui.o \
gtk_history.o gtk_window.o gtk_filetype.o \
gtk_download.o # gtk/
# Default target - platform specific files may specify special-case rules for
# various files.
default: riscos
OBJDIR_RISCOS = $(shell $(CC) -dumpmachine)
# Inclusion of platform specific files has to occur after the OBJDIR stuff as
# that is referred to in the files
OS = riscos
ifeq ($(OS),riscos)
include riscos.mk
else
include posix.mk
endif
OBJDIR_RISCOS = arm-riscos-aof
SOURCES_RISCOS=$(OBJECTS_RISCOS:.o=.c)
OBJS_RISCOS=$(OBJECTS_RISCOS:%.o=$(OBJDIR_RISCOS)/%.o)
@ -91,19 +106,6 @@ OBJDIR_GTK = objects-gtk
SOURCES_GTK=$(OBJECTS_GTK:.o=.c)
OBJS_GTK=$(OBJECTS_GTK:%.o=$(OBJDIR_GTK)/%.o)
# Default target - platform specific files may specify special-case rules for
# various files.
default: riscos
# Inclusion of platform specific files has to occur after the OBJDIR stuff as
# that is referred to in the files
OS = $(word 2,$(subst -, ,$(shell $(SYSTEM_CC) -dumpmachine)))
ifeq ($(OS),riscos)
include riscos.mk
else
include posix.mk
endif
VPATH = content:content/fetchers:css:desktop:image:render:riscos:riscos/configure:riscos/gui:utils:debug:gtk

View File

@ -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),

View File

@ -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];
}