+ float new_zoom(min(drawing_area->get_width() * zoom / w,
+ drawing_area->get_height() * zoom / h) * 0.995);
+ if (zoom / new_zoom > 0.995 && new_zoom / zoom > 0.995)
+ {
+ set_zoom(prev_zoom);
+ return set_focus_point(previous_focus);
+ }
+ previous_focus = get_focus_point();
+ prev_zoom = zoom;
+ set_zoom(new_zoom);
+ set_focus_point(Point(0,0));