]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed problem with the size of paragraphs not needing layout not being taken into...
authorJulian Smart <julian@anthemion.co.uk>
Sun, 30 Oct 2011 17:28:03 +0000 (17:28 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 30 Oct 2011 17:28:03 +0000 (17:28 +0000)
Should fix the problem with lines becoming insensitive to mouse clicks after adding a couple of shorter lines.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69595 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextbuffer.cpp

index 17bcf876015a64bae9e41e4698f31b1b0446c748..3e5344ddddb460a4e8300502779f2f4174f9c3bf 100644 (file)
@@ -1914,6 +1914,20 @@ bool wxRichTextParagraphLayoutBox::Layout(wxDC& dc, const wxRect& rect, int styl
     // A way to force speedy rest-of-buffer layout (the 'else' below)
     bool forceQuickLayout = false;
 
+    // First get the size of the paragraphs we won't be laying out
+    wxRichTextObjectList::compatibility_iterator n = m_children.GetFirst();
+    while (n && n != node)
+    {
+        wxRichTextParagraph* child = wxDynamicCast(n->GetData(), wxRichTextParagraph);
+        if (child)
+        {
+            maxWidth = wxMax(maxWidth, child->GetCachedSize().x);
+            maxMinWidth = wxMax(maxMinWidth, child->GetMinSize().x);
+            maxMaxWidth = wxMax(maxMaxWidth, child->GetMaxSize().x);
+        }
+        n = n->GetNext();
+    }
+
     while (node)
     {
         // Assume this box only contains paragraphs