aboutsummaryrefslogtreecommitdiff
path: root/dw/textblock.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-10-04 16:49:23 +0200
committerSebastian Geerken <devnull@localhost>2014-10-04 16:49:23 +0200
commit28971fb65e8cd4b81b5e8e0f16c2e01205c3d044 (patch)
treeebc2097e33f60cc8edf558d7dd43470169b12743 /dw/textblock.cc
parent8fd2ae404f3f0af087217ba79ff9a35955fb026f (diff)
parent000ad0ab90444230f5bebc5c0a5b28f572e6a013 (diff)
Merge with main repo.
Diffstat (limited to 'dw/textblock.cc')
-rw-r--r--dw/textblock.cc8
1 files changed, 6 insertions, 2 deletions
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;