wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src/widgets textbox.cpp


From: David White
Subject: [Wesnoth-cvs-commits] wesnoth/src/widgets textbox.cpp
Date: Mon, 30 May 2005 00:41:53 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     David White <address@hidden>    05/05/30 04:41:53

Modified files:
        src/widgets    : textbox.cpp 

Log message:
        fixed problem where typing very fast in chat text box could cause the 
game to freeze up for a few seconds

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/textbox.cpp.diff?tr1=1.78&tr2=1.79&r1=text&r2=text

Patches:
Index: wesnoth/src/widgets/textbox.cpp
diff -u wesnoth/src/widgets/textbox.cpp:1.78 
wesnoth/src/widgets/textbox.cpp:1.79
--- wesnoth/src/widgets/textbox.cpp:1.78        Mon May 30 04:18:31 2005
+++ wesnoth/src/widgets/textbox.cpp     Mon May 30 04:41:52 2005
@@ -1,4 +1,4 @@
-/* $Id: textbox.cpp,v 1.78 2005/05/30 04:18:31 Sirp Exp $ */
+/* $Id: textbox.cpp,v 1.79 2005/05/30 04:41:52 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -133,7 +133,11 @@
        draw_solid_tinted_rectangle(loc.x,loc.y,loc.w,loc.h,0,0,0,
                                    focus() ? alpha_focus_ : alpha_, surf);
        
-       SDL_Rect src;
+       SDL_Rect src;
+
+       if(text_image_ == NULL) {
+               update_text_cache(true);
+       }
 
        if(text_image_ != NULL) {
                src.y = yscroll_;
@@ -540,10 +544,12 @@
        //at least the next 500ms.
        show_cursor_ = true;
        show_cursor_at_ = SDL_GetTicks();
+
+       if(changed) {
+               text_image_ = NULL;
+       }
 
-       update_text_cache(changed);
        set_dirty(true);
-       draw();
 }
 
 } //end namespace gui




reply via email to

[Prev in Thread] Current Thread [Next in Thread]