Layout: Apply min/max width to replaced elements when width is given.

This commit is contained in:
Michael Drake 2019-07-30 21:55:29 +01:00
parent 5ee910ffee
commit 4b6967fee4
1 changed files with 5 additions and 0 deletions

View File

@ -220,6 +220,11 @@ layout_get_object_dimensions(struct box *box,
int intrinsic_width = content_get_width(box->object);
int intrinsic_height = content_get_height(box->object);
if (min_width > 0 && min_width > *width)
*width = min_width;
if (max_width >= 0 && max_width < *width)
*width = max_width;
if (intrinsic_width != 0)
*height = (*width * intrinsic_height) /
intrinsic_width;