diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2014-11-17 14:44:24 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2014-12-03 12:25:52 +0100 |
commit | 18ef4f69516c0c7548217532062c62029fb56180 (patch) | |
tree | c22727c4d530b9cfe455f73567766cab7c449095 /source/html | |
parent | 1af9460e3fe591b228870045fe150b61b495a5c4 (diff) | |
download | mupdf-18ef4f69516c0c7548217532062c62029fb56180.tar.xz |
html: Handle text-align when splitting flow boxes.
Diffstat (limited to 'source/html')
-rw-r--r-- | source/html/layout.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/html/layout.c b/source/html/layout.c index c948e02b..bb653cf9 100644 --- a/source/html/layout.c +++ b/source/html/layout.c @@ -22,13 +22,14 @@ static const char *default_css = "sub{vertical-align:sub}" "sup{vertical-align:super}" "s,strike,del{text-decoration:line-through}" -"hr{border:1px inset}" +"hr{border-width:1px;border-color:black}" "ol,ul,dir,menu,dd{margin-left:40px}" "ol{list-style-type:decimal}" "ol ul,ul ol,ul ul,ol ol{margin-top:0;margin-bottom:0}" "u,ins{text-decoration:underline}" "center{text-align:center}" -"svg{display:none}"; +"svg{display:none}" +; static int iswhite(int c) { @@ -168,6 +169,7 @@ static void insert_inline_box(fz_context *ctx, struct box *box, struct box *top) else { struct box *flow = new_box(ctx, NULL); + flow->is_first_flow = !top->last; insert_box(ctx, flow, BOX_FLOW, top); insert_box(ctx, box, BOX_INLINE, flow); } @@ -345,7 +347,7 @@ static void layout_flow(fz_context *ctx, struct box *box, struct box *top, float int align; em = from_number(box->style.font_size, em, em); - indent = from_number(top->style.text_indent, em, top->w); + indent = box->is_first_flow ? from_number(top->style.text_indent, em, top->w) : 0; align = top->style.text_align; box->x = top->x; |