aboutsummaryrefslogtreecommitdiff
path: root/dw/textblock.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/textblock.cc')
-rw-r--r--dw/textblock.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc
index cd301871..3bedcdba 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -807,8 +807,8 @@ void Textblock::calcWidgetSize (core::Widget *widget, core::Requisition *size)
size->width = core::style::absLengthVal (wstyle->width)
+ wstyle->boxDiffWidth ();
else
- size->width = (int) (core::style::perLengthVal (wstyle->width)
- * availWidth);
+ size->width =
+ core::style::multiplyWithPerLength (availWidth, wstyle->width);
if (wstyle->height == core::style::LENGTH_AUTO) {
size->ascent = requisition.ascent;
@@ -820,9 +820,10 @@ void Textblock::calcWidgetSize (core::Widget *widget, core::Requisition *size)
+ wstyle->boxDiffHeight ();
size->descent = 0;
} else {
- double len = core::style::perLengthVal (wstyle->height);
- size->ascent = (int) (len * availAscent);
- size->descent = (int) (len * availDescent);
+ size->ascent =
+ core::style::multiplyWithPerLength (wstyle->height, availAscent);
+ size->descent =
+ core::style::multiplyWithPerLength (wstyle->height, availDescent);
}
}
@@ -1475,9 +1476,9 @@ void Textblock::calcTextSize (const char *text, size_t len,
if (core::style::isAbsLength (style->lineHeight))
height = core::style::absLengthVal(style->lineHeight);
else
- height = lout::misc::roundInt (
- core::style::perLengthVal(style->lineHeight) *
- style->font->size);
+ height =
+ core::style::multiplyWithPerLengthRounded (style->font->size,
+ style->lineHeight);
leading = height - style->font->size;
size->ascent += leading / 2;