[Add] Boundary checking for starmap names.

This commit is contained in:
Allanis 2013-03-10 19:19:14 +00:00
parent 2e6bfd6a4d
commit 938b76b8be

View File

@ -160,10 +160,12 @@ static void map_render(double bx, double by, double w, double h) {
r, bx, by, w, h); r, bx, by, w, h);
// Draw the system name. // Draw the system name.
if(map_zoom >= 1.) // Can't be tiny. tx = x + 7. + sys->pos.x * map_zoom;
gl_printMax(&gl_smallFont, (bx+w)-(x+7. + sys->pos.x * map_zoom), ty = y - 5. + sys->pos.y * map_zoom;
x + 7. + sys->pos.x * map_zoom + gl_screen.w/2., if((map_zoom >= 1.) && // Can't be tiny.
y - 5. + sys->pos.y * map_zoom + gl_screen.h/2., ((tx > bx) && (ty > by) && (ty < by+h-6.))) // Width checking.
gl_printMax(&gl_smallFont, (bx+w)-(tx),
tx + gl_screen.w/2., ty + gl_screen.h/2.,
&cWhite, sys->name); &cWhite, sys->name);
// Draw the hyperspace paths. // Draw the hyperspace paths.