diff options
author | Sebastian Geerken <devnull@localhost> | 2014-07-22 00:59:35 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-07-22 00:59:35 +0200 |
commit | 81567f3ed2175861b9b50f7cd2142d8c6c60d84c (patch) | |
tree | ef027ddf2f619f28419c7e7e59e14497fd003784 /dw/image.cc | |
parent | 394187dd1c45a876677dc5717674ae5eebf8d7af (diff) |
Fixed incomplete intrinsic extremes.
Diffstat (limited to 'dw/image.cc')
-rw-r--r-- | dw/image.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/dw/image.cc b/dw/image.cc index 9dc6d6ee..df8b6e83 100644 --- a/dw/image.cc +++ b/dw/image.cc @@ -217,8 +217,18 @@ void Image::sizeRequestImpl (core::Requisition *requisition) void Image::getExtremesImpl (core::Extremes *extremes) { - extremes->minWidth = extremes->maxWidth = - (buffer ? buffer->getRootWidth () : 0) + boxDiffWidth (); + int width = (buffer ? buffer->getRootWidth () : 0) + boxDiffWidth (); + + // With percentage width, the image may be narrower than the buffer. + extremes->minWidth = + core::style::isPerLength (getStyle()->width) ? boxDiffWidth () : width; + + // (We ignore the same effect for the maximal width.) + extremes->maxWidth = width; + + extremes->minWidthIntrinsic = extremes->minWidth; + extremes->maxWidthIntrinsic = extremes->maxWidth; + correctExtremes (extremes); } |