Author: mordante
Date: Sat Oct 11 19:03:49 2008
New Revision: 30051

URL: http://svn.gna.org/viewcvs/wesnoth?rev=30051&view=rev
Log:
Disable the size caching.

Disable the size caching for now, it gives problems with the new
wrapping code. Postpone the final faith of this code until we know
whether or not the caching is needed for speed.

Modified:
    trunk/src/gui/widgets/grid.cpp

Modified: trunk/src/gui/widgets/grid.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/grid.cpp?rev=30051&r1=30050&r2=30051&view=diff
==============================================================================
--- trunk/src/gui/widgets/grid.cpp (original)
+++ trunk/src/gui/widgets/grid.cpp Sat Oct 11 19:03:49 2008
@@ -19,6 +19,11 @@
 
 #include <cassert>
 #include <numeric>
+
+// Disable the size caching for now, it gives problems with the new wrapping
+// code. Postpone the final faith of this code until we know whether or not the
+// caching is needed for speed.
+#define DISABLE_CACHE 1
 
 namespace gui2 {
 
@@ -584,7 +589,11 @@
                return border_space();
        }
 
+#if DISABLE_CACHE
+       if(true) {
+#else  
        if(widget_->is_dirty() || best_size_ == tpoint(0, 0)) {
+#endif 
                best_size_ = widget_->get_best_size() + border_space();
        }
 
@@ -814,6 +823,10 @@
                tpoint (tchild::*size_proc_max)(const tpoint&) const,
                const tpoint& maximum_size) const
 {
+#if DISABLE_CACHE
+       height.clear();
+       width.clear();
+#endif 
        if(height.empty() || width.empty() || maximum_size != tpoint(0, 0)) {
 
                DBG_GUI << "Grid: calculate " << id << " size.\n";


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to