[Aptitude-devel] r3153 - in branches/aptitude-0.3/aptitude: . src/vscreen

Daniel Burrows dburrows@costa.debian.org
Wed, 27 Apr 2005 16:14:22 +0000


Author: dburrows
Date: Wed Apr 27 16:14:18 2005
New Revision: 3153

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/vscreen/vs_text_layout.cc
Log:
Actually cache the contents of text_layout widgets.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Wed Apr 27 16:14:18 2005
@@ -1,5 +1,10 @@
 2005-04-27  Daniel Burrows  <dburrows@debian.org>
 
+	* src/vscreen/vs_text_layout.cc:
+
+	  Fix the caching of text layouts: the 'lastw' variable wasn't
+	  being updated, so the layout always looked stale!
+
 	* src/vscreen/vs_tree.cc:
 
 	  Remove the grotesque hack of calling highlighted() in paint();

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_text_layout.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_text_layout.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_text_layout.cc	Wed Apr 27 16:14:18 2005
@@ -149,13 +149,13 @@
 
 void vs_text_layout::freshen_contents()
 {
-  if(stale)
+  if(stale || lastw != getmaxx())
     {
       contents=f->layout(getmaxx(), getmaxx());
+      stale=false;
+      lastw=getmaxx();
 
       do_signal();
-
-      stale=false;
     }
 }