- mv_selection = MapVote_Selection(pos, dist, rows, mv_columns);
+ // reduce size to fix aspect ratio
+ if(dist.x / dist.y > item_aspect)
+ dist.x = dist.y * item_aspect;
+ else
+ dist.y = dist.x / item_aspect;
+
+ // adjust table pos and size according to the new size
+ float offset;
+ offset = ((xmax - pos.x) - dist.x * mv_columns) / 2;
+ xmin = pos.x += offset;
+ xmax -= offset;
+ offset = ((ymax - pos.y) - dist.y * rows) / 2;
+ ymax -= 2 * offset;
+
+ // override panel_pos and panel_size
+ panel_pos.x = pos.x;
+ panel_pos.y = pos.y;
+ panel_size.x = xmax - xmin;
+ panel_size.y = ymax - ymin;
+ HUD_Panel_DrawBg(1);
+
+ if(panel_bg_padding)
+ {
+ // FIXME item AR gets slightly changed here...
+ // it's rather hard to avoid it at this point
+ dist.x -= 2 * panel_bg_padding / mv_columns;
+ dist.y -= 2 * panel_bg_padding / rows;
+ xmin = pos.x += panel_bg_padding;
+ ymin = pos.y += panel_bg_padding;
+ xmax -= 2 * panel_bg_padding;
+ ymax -= 2 * panel_bg_padding;
+ }