diff options
author | Sebastian Geerken <devnull@localhost> | 2014-05-04 11:19:50 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-05-04 11:19:50 +0200 |
commit | 73fbb2a306f7e6d458a49f34f5ee75bfd01515b0 (patch) | |
tree | 22addcd205fb231960fa38d5f6cdfd2694ed8b35 | |
parent | aa4fbb808b7b63cf5ffae4ef01db213905569be9 (diff) |
Condider CSS 'width' for the calculation of extremes. This fixes some issues with floats.
-rw-r--r-- | dw/textblock.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc index 99ba6d06..df7fd9f3 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -415,9 +415,21 @@ void Textblock::sizeRequestImpl (core::Requisition *requisition) void Textblock::getWordExtremes (Word *word, core::Extremes *extremes) { if (word->content.type == core::Content::WIDGET_IN_FLOW) { - if (word->content.widget->usesHints ()) + if (word->content.widget->usesHints ()) { word->content.widget->getExtremes (extremes); - else { + + if (core::style::isAbsLength (word->content.widget + ->getStyle()->width)) { + int width = + core::style::absLengthVal (word->content.widget + ->getStyle()->width); + if (extremes->minWidth < width) + extremes->minWidth = width; + if (extremes->maxWidth > width) + // maxWidth not smaller than minWidth + extremes->maxWidth = misc::max (width, extremes->minWidth); + } + } else { if (core::style::isPerLength (word->content.widget->getStyle()->width)) { extremes->minWidth = 0; |