rem: if ((double)dx/dy > (double)screen.drawing_area->allocation.width/screen.drawing_area->allocation.height) {
add: if ((dy == 0) || ((double)dx/dy > (double)screen.drawing_area->allocation.width/screen.drawing_area->allocation.height)) {
context: draw_zoom_outline(gboolean centered){    GdkGC *gc;    GdkGCValues values;    GdkGCValuesMask values_mask;    gint x1, y1, x2, y2, dx, dy;    memset(&values, 0, sizeof(values));    values.function = GDK_XOR;    values.foreground = *screen.zoom_outline_color;    values_mask = GDK_GC_FUNCTION | GDK_GC_FOREGROUND;    gc = gdk_gc_new_with_values(screen.drawing_area->window, &values, values_mask);    x1 = MIN(screen.start_x, screen.last_x);    y1 = MIN(screen.start_y, screen.last_y);    x2 = MAX(screen.start_x, screen.last_x);    y2 = MAX(screen.start_y, screen.last_y);    dx = x2-x1;    dy = y2-y1;    if (centered) {	/* Centered outline mode */	x1 = screen.start_x - dx;	y1 = screen.start_y - dy;	dx *= 2;	dy *= 2;	x2 = x1+dx;	y2 = y1+dy;    }    gdk_draw_rectangle(screen.drawing_area->window, gc, FALSE, x1, y1, dx, dy);    gdk_gc_unref(gc);    /* Draw actual zoom area in dashed lines */    memset(&values, 0, sizeof(values));    values.function = GDK_XOR;    values.foreground = *screen.dist_measure_color;    values.line_style = GDK_LINE_ON_OFF_DASH;    values_mask = GDK_GC_FUNCTION | GDK_GC_FOREGROUND | GDK_GC_LINE_STYLE;    gc = gdk_gc_new_with_values(screen.drawing_area->window, &values,				values_mask);    if ((double)dx/dy > (double)screen.drawing_area->allocation.width/screen.drawing_area->allocation.height) {	    dy = dx * (double)screen.drawing_area->allocation.height/screen.drawing_area->allocation.width;    } else {	    dx = dy * (double)screen.drawing_area->allocation.width/screen.drawing_area->allocation.height;    }    gdk_draw_rectangle(screen.drawing_area->window, gc, FALSE, (x1+x2-dx)/2, (y1+y2-dy)/2, dx, dy);    gdk_gc_unref(gc);}