changeset 1867:84e4142b1e03 draft

(svn r2373) - CodeChange: don't redraw the window upon a user-based dirty request if the requested widget is invisible or otherwise not visible (type WWT_EMPTY)
author Darkvater <Darkvater@openttd.org>
date Sat, 28 May 2005 17:01:26 +0000
parents 2c61fb1c4f5f
children 009c51ee47d0
files window.c
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/window.c
+++ b/window.c
@@ -1541,13 +1541,11 @@
 void InvalidateWidget(Window *w, byte widget_index)
 {
 	const Widget *wi = &w->widget[widget_index];
-//	if (wi->left != -2) {
-		SetDirtyBlocks(
-			w->left + wi->left,
-			w->top + wi->top,
-			w->left + wi->right + 1,
-			w->top + wi->bottom + 1);
-//	}
+
+	/* Don't redraw the window if the widget is invisible or of no-type */
+	if (wi->type == WWT_EMPTY || HASBIT(w->hidden_state, widget_index)) return;
+
+	SetDirtyBlocks(w->left + wi->left, w->top + wi->top, w->left + wi->right + 1, w->top + wi->bottom + 1);
 }
 
 void InvalidateWindowWidget(byte cls, WindowNumber number, byte widget_index)