(svn r13979) -Codechange: Use widget dimensions instead of magic number incantations for limiting small map area.
authorpeter1138
Sun, 03 Aug 2008 18:00:28 +0000
changeset 9836 aa56bba741a2
parent 9835 b40b96c9b74b
child 9837 8d4c9e463e5e
(svn r13979) -Codechange: Use widget dimensions instead of magic number incantations for limiting small map area.
src/smallmap_gui.cpp
--- a/src/smallmap_gui.cpp	Sun Aug 03 17:36:39 2008 +0000
+++ b/src/smallmap_gui.cpp	Sun Aug 03 18:00:28 2008 +0000
@@ -896,7 +896,8 @@
 			}
 		}
 
-		if (!FillDrawPixelInfo(&new_dpi, 3, 17, this->width - 28 + 22, this->height - 64 - 11 - diff)) return;
+		const Widget *wi = &this->widget[SM_WIDGET_MAP];
+		if (!FillDrawPixelInfo(&new_dpi, wi->left + 1, wi->top + 1, wi->right - wi->left - 1, wi->bottom - wi->top - 1)) return;
 
 		this->DrawSmallMap(&new_dpi);
 	}