diff options
author | Sebastian Geerken <devnull@localhost> | 2014-10-04 16:49:23 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-10-04 16:49:23 +0200 |
commit | 28971fb65e8cd4b81b5e8e0f16c2e01205c3d044 (patch) | |
tree | ebc2097e33f60cc8edf558d7dd43470169b12743 | |
parent | 8fd2ae404f3f0af087217ba79ff9a35955fb026f (diff) | |
parent | 000ad0ab90444230f5bebc5c0a5b28f572e6a013 (diff) |
Merge with main repo.
-rw-r--r-- | dw/ooffloatsmgr.cc | 20 | ||||
-rw-r--r-- | dw/textblock.cc | 8 |
2 files changed, 20 insertions, 8 deletions
diff --git a/dw/ooffloatsmgr.cc b/dw/ooffloatsmgr.cc index cce69718..655fa743 100644 --- a/dw/ooffloatsmgr.cc +++ b/dw/ooffloatsmgr.cc @@ -2206,12 +2206,20 @@ int OOFFloatsMgr::getClearPosition (OOFAwareWidget *textblock, Side side) } else { Float *vloat = list->get(i); assert (vloat->generatingBlock != textblock); - ensureFloatSize (vloat); - pos = vloat->yReal + vloat->size.ascent + vloat->size.descent - - getAllocation(textblock)->y; - DBG_OBJ_MSGF ("resize.oofm", 1, "float %p => %d + (%d + %d) - %d", - vloat->getWidget (), vloat->yReal, vloat->size.ascent, - vloat->size.descent, getAllocation(textblock)->y); + if (!wasAllocated (vloat->generatingBlock)) + pos = 0; // See above. + else { + ensureFloatSize (vloat); + pos = getAllocation(vloat->generatingBlock)->y + vloat->yReal + + vloat->size.ascent + vloat->size.descent + - getAllocation(textblock)->y; + DBG_OBJ_MSGF ("resize.oofm", 1, + "float %p => %d + %d + (%d + %d) - %d", + vloat->getWidget (), + getAllocation(vloat->generatingBlock)->y, + vloat->yReal, vloat->size.ascent, vloat->size.descent, + getAllocation(textblock)->y); + } } } diff --git a/dw/textblock.cc b/dw/textblock.cc index b31cbfbd..5e5bd264 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -557,8 +557,12 @@ void Textblock::sizeAllocateImpl (core::Allocation *allocation) for (lineIndex = 0; lineIndex < lines->size (); lineIndex++) { // Especially for floats, allocation->width may be different // from the line break width, so that for centered and right - // text, the offsets have to be recalculated again. - calcTextOffset (lineIndex, childBaseAllocation.width); + // text, the offsets have to be recalculated again. However, if + // the allocation width is greater than the line break width, + // due to wide unbreakable lines (large image etc.), use the + // original line break width. + calcTextOffset (lineIndex, + misc::min (childBaseAllocation.width, lineBreakWidth)); line = lines->getRef (lineIndex); xCursor = line->textOffset; |