aboutsummaryrefslogtreecommitdiff
path: root/dw
diff options
context:
space:
mode:
Diffstat (limited to 'dw')
-rw-r--r--dw/textblock.cc12
-rw-r--r--dw/textblock_linebreaking.cc8
2 files changed, 16 insertions, 4 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc
index df0b926e..826b6648 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -142,6 +142,9 @@ void Textblock::sizeRequestImpl (core::Requisition *requisition)
Line *lastLine = lines->getRef (lines->size () - 1);
requisition->width = lastLine->maxLineWidth;
+ PRINTF ("[%p] SIZE_REQUEST: lastLine->maxLineWidth = %d\n",
+ this, lastLine->maxLineWidth);
+
PRINTF ("[%p] SIZE_REQUEST: lines[0]->boxAscent = %d\n",
this, lines->getRef(0)->boxAscent);
PRINTF ("[%p] SIZE_REQUEST: lines[%d]->top = %d\n",
@@ -163,6 +166,9 @@ void Textblock::sizeRequestImpl (core::Requisition *requisition)
requisition->descent = 0;
}
+ PRINTF ("[%p] SIZE_REQUEST: inner padding = %d, boxDiffWidth = %d\n",
+ this, innerPadding, getStyle()->boxDiffWidth ());
+
requisition->width += innerPadding + getStyle()->boxDiffWidth ();
requisition->ascent += getStyle()->boxOffsetY ();
requisition->descent += getStyle()->boxRestHeight ();
@@ -170,8 +176,8 @@ void Textblock::sizeRequestImpl (core::Requisition *requisition)
if (requisition->width < availWidth)
requisition->width = availWidth;
- PRINTF("[%p] SIZE_REQUEST: %d x %d + %d\n", this, requisition->width,
- requisition->ascent, requisition->descent);
+ PRINTF ("[%p] SIZE_REQUEST: %d x %d + %d\n", this, requisition->width,
+ requisition->ascent, requisition->descent);
}
/**
@@ -1495,7 +1501,7 @@ void Textblock::addWidget (core::Widget *widget, core::style::Style *style)
* end of this function, the correct value is assigned. */
widget->parentRef = -1;
- PRINTF("%p becomes child of %p\n", widget, this);
+ PRINTF ("%p becomes child of %p\n", widget, this);
widget->setParent (this);
widget->setStyle (style);
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc
index 92f8b3bb..5ca556c8 100644
--- a/dw/textblock_linebreaking.cc
+++ b/dw/textblock_linebreaking.cc
@@ -261,6 +261,13 @@ Textblock::Line *Textblock::addLine (int firstWord, int lastWord,
line->breakSpace = 0;
line->leftOffset = 0;
+ alignLine (line);
+ for (int i = line->firstWord; i < line->lastWord; i++) {
+ Word *word = words->getRef (i);
+ lineWidth += (word->effSpace - word->origSpace);
+ }
+
+
if (lines->size () == 1) {
line->top = 0;
@@ -301,7 +308,6 @@ Textblock::Line *Textblock::addLine (int firstWord, int lastWord,
PRINTF (" line[%d].contentDescent = %d\n",
lines->size () - 1, line->contentDescent);
- alignLine (line);
mustQueueResize = true;
return line;