projects
/
psensor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
avoid use of GtkWidget.allocation (does not exist in gtk3)
[psensor.git]
/
src
/
graph.c
diff --git
a/src/graph.c
b/src/graph.c
index
2625ce5
..
f4349d3
100644
(file)
--- a/
src/graph.c
+++ b/
src/graph.c
@@
-201,29
+201,28
@@
graph_update(struct psensor **sensors,
double maxt = get_max_temp(sensors);
char *strmax = psensor_value_to_string(SENSOR_TYPE_TEMP, maxt);
double maxt = get_max_temp(sensors);
char *strmax = psensor_value_to_string(SENSOR_TYPE_TEMP, maxt);
- int width = w_graph->allocation.width;
- int height = w_graph->allocation.height;
-
- int g_width, g_height;
+ int width, height, g_width, g_height;
/* horizontal and vertical offset of the graph */
int g_xoff, g_yoff;
/* horizontal and vertical offset of the graph */
int g_xoff, g_yoff;
- cairo_surface_t *cst = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
- width,
- height);
- cairo_t *cr = cairo_create(cst);
- cairo_t *cr_pixmap;
+ cairo_surface_t *cst;
+ cairo_t *cr, *cr_pixmap;
char *str_btime = time_to_str(get_graph_begin_time_s(config));
char *str_btime = time_to_str(get_graph_begin_time_s(config));
- cairo_text_extents_t te_btime;
-
char *str_etime = time_to_str(get_graph_end_time_s());
char *str_etime = time_to_str(get_graph_end_time_s());
- cairo_text_extents_t te_etime;
- cairo_text_extents_t te_max, te_min;
+ cairo_text_extents_t te_
btime, te_etime, te_
max, te_min;
struct psensor **sensor_cur;
struct psensor **sensor_cur;
+ GtkAllocation galloc;
+
+ gtk_widget_get_allocation(w_graph, &galloc);
+ width = galloc.width;
+ height = galloc.height;
+
+ cst = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
+ cr = cairo_create(cst);
draw_graph_background(cr, width, height, config);
draw_graph_background(cr, width, height, config);