]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed layout and hit-testing problem particularly with centred lines
authorJulian Smart <julian@anthemion.co.uk>
Fri, 11 May 2012 22:15:39 +0000 (22:15 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 11 May 2012 22:15:39 +0000 (22:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71419 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextbuffer.cpp

index fce3cffe9d01cc2df0bb9d762ee74f9a96a19bf8..349fc01ccbda6f3544852f51025f7baf8fe062d6 100644 (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);