Fixed layout and hit-testing problem particularly with centred lines

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71419 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2012-05-11 22:15:39 +00:00
parent 5e4027e5ad
commit d157d142f6

View File

@@ -1870,6 +1870,10 @@ bool wxRichTextParagraphLayoutBox::Layout(wxDC& dc, wxRichTextDrawingContext& co
availableSpace = GetAvailableContentArea(dc, context, rect);
}
// Fix the width if we're at the top level
if (!GetParent())
attr.GetTextBoxAttr().GetWidth().SetValue(rect.GetWidth(), wxTEXT_ATTR_UNITS_PIXELS);
int leftMargin, rightMargin, topMargin, bottomMargin;
wxRichTextObject::GetTotalMargin(dc, GetBuffer(), attr, leftMargin, rightMargin,
topMargin, bottomMargin);