[Add] Boundary checking for starmap names.
This commit is contained in:
parent
2e6bfd6a4d
commit
938b76b8be
10
src/map.c
10
src/map.c
@ -160,10 +160,12 @@ static void map_render(double bx, double by, double w, double h) {
|
||||
r, bx, by, w, h);
|
||||
|
||||
// Draw the system name.
|
||||
if(map_zoom >= 1.) // Can't be tiny.
|
||||
gl_printMax(&gl_smallFont, (bx+w)-(x+7. + sys->pos.x * map_zoom),
|
||||
x + 7. + sys->pos.x * map_zoom + gl_screen.w/2.,
|
||||
y - 5. + sys->pos.y * map_zoom + gl_screen.h/2.,
|
||||
tx = x + 7. + sys->pos.x * map_zoom;
|
||||
ty = y - 5. + sys->pos.y * map_zoom;
|
||||
if((map_zoom >= 1.) && // Can't be tiny.
|
||||
((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);
|
||||
|
||||
// Draw the hyperspace paths.
|
||||
|
Loading…
Reference in New Issue
Block a user