Use specified height in a text box, if there is one

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2013-10-24 07:00:59 +00:00
parent 830a43c468
commit b1fbde6261

View File

@@ -2139,9 +2139,15 @@ bool wxRichTextParagraphLayoutBox::Layout(wxDC& dc, wxRichTextDrawingContext& co
// breaking layout of a box within a paragraph.
}
// TODO: (also in para layout) should set the
// object's size to an absolute one if specified,
// but if not specified, calculate it from content.
if (attr.GetTextBoxAttr().GetSize().GetHeight().IsValid())
{
wxRect r = AdjustAvailableSpace(dc, GetBuffer(), wxRichTextAttr() /* not used */, attr, parentRect, parentRect);
int h = r.GetHeight();
// Convert external to content rect
h = h - topMargin - bottomMargin;
maxHeight = wxMax(maxHeight, h);
}
// We need to add back the margins etc.
{