Browse files

testing redraw change

  • Loading branch information...
1 parent 1176fe9 commit 3bafe895d08ef58ca8eca979ff4cbdb1f73bbf16 @pchilds committed Nov 5, 2012
View
12 gtk2plot/gtkplotlinear.c
@@ -3933,6 +3933,13 @@ gboolean gtk_plot_linear_update_scale_pretty(GtkWidget *widget, gdouble xl, gdou
return FALSE;
}
+gboolean gtk_plot_linear_print(GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer data)
+{
+ cairo_t* cr=gtk_print_context_get_cairo_context(context);
+ draw(GTK_WIDGET(data), cr);
+ return FALSE;
+}
+
gboolean gtk_plot_linear_print_eps(GtkWidget *plot, gchar* fout)
{
cairo_t *cr;
@@ -4074,7 +4081,7 @@ static gboolean gtk_plot_linear_button_release(GtkWidget *widget, GdkEventButton
yn=(priv->rescale.ymax)-(priv->rescale.ymin);
if (((xn>DZE)||(xn<NZE))&&((yn>DZE)||(yn<NZE)))
{
- if (((plot->zmode)&GTK_PLOT_LINEAR_ZOOM_DRG)!=0) gtk_plot_linear_update_scale_pretty(widget, xn+(priv->bounds.xmin), xn+(priv->bounds.xmax), yn+(priv->bounds.ymin), yn+(priv->bounds.ymax));
+ if (((plot->zmode)&GTK_PLOT_LINEAR_ZOOM_DRG)!=0) gtk_plot_linear_update_scale_pretty(widget, (priv->bounds.xmin)-xn, (priv->bounds.xmax)-xn, (priv->bounds.ymin)-yn, (priv->bounds.ymax)-yn);
else if (((plot->zmode)&GTK_PLOT_LINEAR_ZOOM_OUT)==0) gtk_plot_linear_update_scale_pretty(widget, (priv->rescale.xmin), (priv->rescale.xmax), (priv->rescale.ymin), (priv->rescale.ymax));
else
{
@@ -4180,7 +4187,8 @@ static gboolean gtk_plot_linear_button_release(GtkWidget *widget, GdkEventButton
else (plot->zmode)|=GTK_PLOT_LINEAR_ZOOM_SGL;
}
}
- gtk_plot_linear_redraw(widget);
+ //gtk_plot_linear_redraw(widget);
+ gtk_widget_queue_draw_area(widget, xw-22, 0, 22, 11);
}
}
return FALSE;
View
1 gtk2plot/gtkplotlinear.h
@@ -68,6 +68,7 @@
};
gboolean gtk_plot_linear_update_scale(GtkWidget *widget, gdouble xn, gdouble xx, gdouble yn, gdouble yx);
gboolean gtk_plot_linear_update_scale_pretty(GtkWidget *widget, gdouble xl, gdouble xu, gdouble yl, gdouble yu);
+ gboolean gtk_plot_linear_print(GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer data);
gboolean gtk_plot_linear_print_eps(GtkWidget *widget, gchar *fout);
gboolean gtk_plot_linear_print_png(GtkWidget *widget, gchar *fout);
gboolean gtk_plot_linear_print_svg(GtkWidget *widget, gchar *fout);
View
7 gtk2plot/gtkplotpolar.c
@@ -5301,6 +5301,13 @@ gboolean gtk_plot_polar_update_scale_pretty(GtkWidget *widget, gdouble xn, gdoub
return FALSE;
}
+gboolean gtk_plot_polar_print(GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer data)
+{
+ cairo_t* cr=gtk_print_context_get_cairo_context(context);
+ draw(GTK_WIDGET(data), cr);
+ return FALSE;
+}
+
gboolean gtk_plot_polar_print_eps(GtkWidget *plot, gchar* fout)
{
cairo_t *cr;
View
1 gtk2plot/gtkplotpolar.h
@@ -70,6 +70,7 @@
};
gboolean gtk_plot_polar_update_scale(GtkWidget *widget, gdouble rn, gdouble rx, gdouble thn, gdouble thx, gdouble tcn, gdouble thc);
gboolean gtk_plot_polar_update_scale_pretty(GtkWidget *widget, gdouble xn, gdouble xx, gdouble yn, gdouble yx);
+ gboolean gtk_plot_polar_print(GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer data);
gboolean gtk_plot_polar_print_eps(GtkWidget *widget, gchar *fout);
gboolean gtk_plot_polar_print_png(GtkWidget *widget, gchar *fout);
gboolean gtk_plot_polar_print_svg(GtkWidget *widget, gchar *fout);
View
12 gtk3plot/gtkplotlinear.c
@@ -3913,6 +3913,13 @@ gboolean gtk_plot_linear_update_scale_pretty(GtkWidget *widget, gdouble xl, gdou
return FALSE;
}
+gboolean gtk_plot_linear_print(GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer data)
+{
+ cairo_t* cr=gtk_print_context_get_cairo_context(context);
+ draw(GTK_WIDGET(data), cr);
+ return FALSE;
+}
+
gboolean gtk_plot_linear_print_eps(GtkWidget *plot, gchar* fout)
{
cairo_t *cr;
@@ -4047,7 +4054,7 @@ static gboolean gtk_plot_linear_button_release(GtkWidget *widget, GdkEventButton
yn=(priv->rescale.ymax)-(priv->rescale.ymin);
if (((xn>DZE)||(xn<NZE))&&((yn>DZE)||(yn<NZE)))
{
- if (((plot->zmode)&GTK_PLOT_LINEAR_ZOOM_DRG)!=0) gtk_plot_linear_update_scale_pretty(widget, xn+(priv->bounds.xmin), xn+(priv->bounds.xmax), yn+(priv->bounds.ymin), yn+(priv->bounds.ymax));
+ if (((plot->zmode)&GTK_PLOT_LINEAR_ZOOM_DRG)!=0) gtk_plot_linear_update_scale_pretty(widget, (priv->bounds.xmin)-xn, (priv->bounds.xmax)-xn, (priv->bounds.ymin)-yn, (priv->bounds.ymax)-yn);
else if (((plot->zmode)&GTK_PLOT_LINEAR_ZOOM_OUT)==0) gtk_plot_linear_update_scale_pretty(widget, (priv->rescale.xmin), (priv->rescale.xmax), (priv->rescale.ymin), (priv->rescale.ymax));
else
{
@@ -4152,7 +4159,8 @@ static gboolean gtk_plot_linear_button_release(GtkWidget *widget, GdkEventButton
else (plot->zmode)|=GTK_PLOT_LINEAR_ZOOM_SGL;
}
}
- gtk_plot_linear_redraw(widget);
+ //gtk_plot_linear_redraw(widget);
+ gtk_widget_queue_draw_area(widget, xw-22, 0, 22, 11);
}
}
return FALSE;
View
1 gtk3plot/gtkplotlinear.h
@@ -66,6 +66,7 @@
};
gboolean gtk_plot_linear_update_scale(GtkWidget *widget, gdouble xn, gdouble xx, gdouble yn, gdouble yx);
gboolean gtk_plot_linear_update_scale_pretty(GtkWidget *widget, gdouble xl, gdouble xu, gdouble yl, gdouble yu);
+ gboolean gtk_plot_linear_print(GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer data);
gboolean gtk_plot_linear_print_eps(GtkWidget *widget, gchar *fout);
gboolean gtk_plot_linear_print_png(GtkWidget *widget, gchar *fout);
gboolean gtk_plot_linear_print_svg(GtkWidget *widget, gchar *fout);
View
7 gtk3plot/gtkplotpolar.c
@@ -5296,6 +5296,13 @@ gboolean gtk_plot_polar_update_scale_pretty(GtkWidget *widget, gdouble xn, gdoub
return FALSE;
}
+gboolean gtk_plot_polar_print(GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer data)
+{
+ cairo_t* cr=gtk_print_context_get_cairo_context(context);
+ draw(GTK_WIDGET(data), cr);
+ return FALSE;
+}
+
gboolean gtk_plot_polar_print_eps(GtkWidget *plot, gchar* fout)
{
cairo_t *cr;
View
1 gtk3plot/gtkplotpolar.h
@@ -68,6 +68,7 @@
};
gboolean gtk_plot_polar_update_scale(GtkWidget *widget, gdouble rn, gdouble rx, gdouble thn, gdouble thx, gdouble tcn, gdouble thc);
gboolean gtk_plot_polar_update_scale_pretty(GtkWidget *widget, gdouble xn, gdouble xx, gdouble yn, gdouble yx);
+ gboolean gtk_plot_polar_print(GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer data);
gboolean gtk_plot_polar_print_eps(GtkWidget *widget, gchar *fout);
gboolean gtk_plot_polar_print_png(GtkWidget *widget, gchar *fout);
gboolean gtk_plot_polar_print_svg(GtkWidget *widget, gchar *fout);

0 comments on commit 3bafe89

Please sign in to comment.