stop chart from jumping around as much as it does when selecting system

This commit is contained in:
Kevin Anthoney 2016-04-22 13:27:52 +01:00
parent 18a418dbe9
commit e47dff3eaf
2 changed files with 4 additions and 4 deletions

View File

@ -708,8 +708,7 @@ NSComparisonResult marketSorterByMassUnit(id a, id b, void *market);
info_system_id = sid;
if (gui_screen == GUI_SCREEN_LONG_RANGE_CHART || gui_screen == GUI_SCREEN_SHORT_RANGE_CHART)
{
target_chart_centre = [[UNIVERSE systemManager] getCoordinatesForSystem:info_system_id inGalaxy:galaxy_number];
target_chart_focus = target_chart_centre;
target_chart_focus = [[UNIVERSE systemManager] getCoordinatesForSystem:info_system_id inGalaxy:galaxy_number];
}
else
{

View File

@ -1851,8 +1851,9 @@ static NSTimeInterval time_last_frame;
if (fabs(maus.x - mouse_click_position.x)*MAIN_GUI_PIXEL_WIDTH > 2 ||
fabs(maus.y - mouse_click_position.y)*MAIN_GUI_PIXEL_HEIGHT > 2)
{
target_chart_centre.x = OOClamp_0_max_f(centre_at_mouse_click.x - (maus.x - mouse_click_position.x)*MAIN_GUI_PIXEL_WIDTH/hscale, 256.0);
target_chart_centre.y = OOClamp_0_max_f(centre_at_mouse_click.y - (maus.y - mouse_click_position.y)*MAIN_GUI_PIXEL_HEIGHT/vscale, 256.0);
chart_centre_coordinates.x = OOClamp_0_max_f(centre_at_mouse_click.x - (maus.x - mouse_click_position.x)*MAIN_GUI_PIXEL_WIDTH/hscale, 256.0);
chart_centre_coordinates.y = OOClamp_0_max_f(centre_at_mouse_click.y - (maus.y - mouse_click_position.y)*MAIN_GUI_PIXEL_HEIGHT/vscale, 256.0);
target_chart_centre = chart_centre_coordinates;
dragging = YES;
}
if (gui_screen == GUI_SCREEN_LONG_RANGE_CHART)