diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2016-06-04 19:33:27 -0400 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2016-06-04 19:33:27 -0400 |
commit | 49fed8fae7ae99e4af9cb878c0a4558c54064861 (patch) | |
tree | f3630a18c6caa041e2a9a7fdc6332a1ed7a0c21c /dw/textblock.cc | |
parent | bff442ac673109f2ea5c0c3fcdbd66f30dfe5eb8 (diff) |
imported patch pos-adjustments
Diffstat (limited to 'dw/textblock.cc')
-rw-r--r-- | dw/textblock.cc | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc index b70376a6..ce93fd36 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -3119,7 +3119,7 @@ int Textblock::getGeneratorRest (int oofmIndex) int width = getGeneratorWidth (0, 0); rest = container->getGeneratorWidth (xRef, width) - (xRef + width); } else { - // Only callend for floats, so this should not happen: + // Only called for floats, so this should not happen: assertNotReached (); rest = 0; } @@ -3132,15 +3132,31 @@ int Textblock::getGeneratorWidth (int callerX, int callerWidth) { DBG_OBJ_ENTER ("resize", 0, "Textblock::getGeneratorWidth", "%d, %d", callerX, callerWidth); - + + if (0 && lines->size () > 0) { + Word *lastWordOfLine, *lwol0; + lwol0 = words->getRef(lines->getRef(0)->lastWord); + lastWordOfLine = words->getRef(lines->getLastRef()->lastWord); + MSG("lww=%d lwol0=%d ", lastWordOfLine->totalWidth, lwol0->totalWidth); + MSG("lbw0=%d lbwl=%d\n", + calcLineBreakWidth(0), + calcLineBreakWidth(lines->size() - 1)); + } // Cf. sizeRequestImpl. if (usesMaxGeneratorWidth ()) { DBG_OBJ_LEAVE_VAL ("%d", lineBreakWidth); return lineBreakWidth; } else { +#if 0 + int w0 = max (lines->size () > 0 ? lines->getLastRef()->maxLineWidth : 0, + callerX + callerWidth); + ... + w = min (w0 + leftInnerPadding + boxDiffWidth (), lineBreakWidth); +#else int w0 = max (lines->size () > 0 ? lines->getLastRef()->maxLineWidth : 0, callerX + callerWidth), w = min (w0 + leftInnerPadding + boxDiffWidth (), lineBreakWidth); +#endif DBG_OBJ_LEAVE_VAL ("min (%d + %d + %d, %d) = %d", w0, leftInnerPadding, boxDiffWidth (), lineBreakWidth, w); |