summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-12-23 17:59:34 +0000
committersmatz <smatz@openttd.org>2009-12-23 17:59:34 +0000
commitfbaba4e6bd93cacdadd393f2b7f65b44b55bfe18 (patch)
tree7421307af907feea661833178e359483c059c1cc
parent82f927bd169876d74e40fcd3d041d9847bed3441 (diff)
downloadopenttd-fbaba4e6bd93cacdadd393f2b7f65b44b55bfe18.tar.xz
(svn r18614) -Fix [FS#3412](r18602): too many signs were drawn, causing slowdowns
-rw-r--r--src/viewport.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp
index ccbca4d8a..313a2d376 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -1085,10 +1085,10 @@ void ViewportAddString(const DrawPixelInfo *dpi, ZoomLevel small_from, const Vie
int sign_height = ScaleByZoom(VPSM_TOP + FONT_HEIGHT_NORMAL + VPSM_BOTTOM, dpi->zoom);
int sign_half_width = ScaleByZoom((small ? sign->width_small : sign->width_normal) / 2, dpi->zoom);
- if (bottom < sign->top &&
- top > sign->top + sign_height &&
- right < sign->center - sign_half_width &&
- left > sign->center + sign_half_width) {
+ if (bottom < sign->top ||
+ top > sign->top + sign_height ||
+ right < sign->center - sign_half_width ||
+ left > sign->center + sign_half_width) {
return;
}