static int toggle_fit_cb(GVJ_t * job)
{
+/*FIXME - should allow for margins */
+/* - similar zoom_to_fit code exists in: */
+/* plugin/gtk/callbacks.c */
+/* plugin/xlib/gvdevice_xlib.c */
+/* lib/gvc/gvevent.c */
+
job->fit_mode = !job->fit_mode;
if (job->fit_mode) {
/* FIXME - this code looks wrong */
GVJ_t *job;
double zoom_to_fit;
+/*FIXME - should allow for margins */
+/* - similar zoom_to_fit code exists in: */
+/* plugin/gtk/callbacks.c */
+/* plugin/xlib/gvdevice_xlib.c */
+/* lib/gvc/gvevent.c */
+
job = (GVJ_t *)g_object_get_data(G_OBJECT(widget),"job");
if (! job->has_been_rendered) {
zoom_to_fit = MIN((double) event->width / (double) job->width,
static void handle_configure_notify(GVJ_t * job, XConfigureEvent * cev)
{
+/*FIXME - should allow for margins */
+/* - similar zoom_to_fit code exists in: */
+/* plugin/gtk/callbacks.c */
+/* 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);