diff --git a/docs/changes.txt b/docs/changes.txt index 199ed94c2f..e98ae23307 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -131,6 +131,7 @@ All (GUI): best size if needed. - Made wxSpinCtrl::Reparent() in MSW and generic versions (Angelo Mottola). - Fixed timing of malformed animated GIFs in wxHTML (Gennady Feller). +- Fixed incorrect layout width caching in wxHTML (Jeff Tupper). All (Unix): diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index 73c7ba04e2..7ef655e2ce 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -750,7 +750,9 @@ void wxHtmlContainerCell::Layout(int w) { wxHtmlCell::Layout(w); - if (m_LastLayout == w) return; + if (m_LastLayout == w) + return; + m_LastLayout = w; // VS: Any attempt to layout with negative or zero width leads to hell, // but we can't ignore such attempts completely, since it sometimes @@ -1006,8 +1008,6 @@ void wxHtmlContainerCell::Layout(int w) m_MaxTotalWidth += s_indent + ((m_IndentRight < 0) ? (-m_IndentRight * m_Width / 100) : m_IndentRight); MaxLineWidth += s_indent + ((m_IndentRight < 0) ? (-m_IndentRight * m_Width / 100) : m_IndentRight); if (m_Width < MaxLineWidth) m_Width = MaxLineWidth; - - m_LastLayout = w; } void wxHtmlContainerCell::UpdateRenderingStatePre(wxHtmlRenderingInfo& info,