]> granicus.if.org Git - graphviz/commitdiff
adjust zoom when window resized
authorellson <devnull@localhost>
Tue, 14 Oct 2008 13:51:30 +0000 (13:51 +0000)
committerellson <devnull@localhost>
Tue, 14 Oct 2008 13:51:30 +0000 (13:51 +0000)
plugin/xlib/gvdevice_xlib.c

index 70970fbe909256a0f30cc0aca7506ff2ec920874..d6619536632b9f5cc4304f18dd585d2985ddc493 100644 (file)
@@ -88,9 +88,9 @@ static void handle_configure_notify(GVJ_t * job, XConfigureEvent * cev)
 /*     plugin/xlib/gvdevice_xlib.c */
 /*     lib/gvc/gvevent.c */
 
-    if (job->fit_mode)
-        job->zoom = MIN((double) cev->width / (double) job->width,
-                       (double) cev->height / (double) job->height);
+    job->zoom *= 1 + MIN(
+       ((double) cev->width - (double) job->width) / (double) job->width,
+       ((double) cev->height - (double) job->height) / (double) job->height);
     if (cev->width > job->width || cev->height > job->height)
         job->has_grown = 1;
     job->width = cev->width;