summaryrefslogtreecommitdiff
path: root/render/layout.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-02-10 11:50:04 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2013-02-10 11:50:04 +0000
commit2a4b9b2217bd2931b6cd615f7d4727ae24a8c35c (patch)
tree177464b6c4805d70f44eb66f6f668ae7a95b992c /render/layout.c
parent4ffa39177deab3403faa8a187c668b722b50edfb (diff)
downloadnetsurf-2a4b9b2217bd2931b6cd615f7d4727ae24a8c35c.tar.gz
netsurf-2a4b9b2217bd2931b6cd615f7d4727ae24a8c35c.tar.bz2
Comment current html wrap/text-splitting behaviour.
Diffstat (limited to 'render/layout.c')
-rw-r--r--render/layout.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/render/layout.c b/render/layout.c
index 331e1efdb..25d6c2448 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -2712,8 +2712,7 @@ bool layout_line(struct box *first, int *width, int *y,
!(split_box->flags & REPLACE_DIM) &&
!(split_box->flags & IFRAME) &&
!split_box->gadget && split_box->text) {
- /* skip leading spaces, otherwise code gets fooled into
- * thinking it's all one long word */
+ /* skip leading spaces */
for (i = 0; i != split_box->length &&
split_box->text[i] == ' '; i++)
;
@@ -2721,15 +2720,18 @@ bool layout_line(struct box *first, int *width, int *y,
for (; i != split_box->length &&
split_box->text[i] != ' '; i++)
;
+ /* if not at end of text, we've found a split point */
if (i != split_box->length)
space = i;
}
- /* space != 0 implies split_box->text != 0 */
+ /* space != 0 implies split_box->text != 0
+ * and that there is a place we could split the text at */
if (space == 0 || no_wrap)
w = split_box->width;
else {
+ /* find width of the text to where we could split */
font_plot_style_from_css(split_box->style, &fstyle);
/** \todo handle errors */
font_func->font_width(&fstyle, split_box->text,