From e62f4f920e007d548fade076f2229d2526d47d38 Mon Sep 17 00:00:00 2001 From: Maria Date: Wed, 8 Jan 2014 18:20:19 +0100 Subject: Fix ROI-rectangle --- bin/gui/control.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/gui/control.c b/bin/gui/control.c index 71a94c5..545c095 100644 --- a/bin/gui/control.c +++ b/bin/gui/control.c @@ -432,6 +432,16 @@ on_motion_notify (GtkWidget *event_box, GdkEventMotion *event, ThreadData *data) g_string_free (string, TRUE); } + if (data->cr != NULL) { + gdouble dash = 5.0; + cairo_set_source_rgb (data->cr, data->red, data->green, data->blue); + gint rect_width = data->rect_evx - data->rect_x; + gint rect_height = data->rect_evy - data->rect_y; + cairo_rectangle (data->cr, data->rect_x, data->rect_y, rect_width, rect_height); + cairo_set_dash (data->cr, &dash, 1, 0); + cairo_stroke (data->cr); + gtk_widget_queue_draw (event_box); + } } static void @@ -474,6 +484,7 @@ static void on_button_release (GtkWidget *event_box, GdkEventMotion *event, ThreadData *data) { cairo_destroy (data->cr); + data->cr = NULL; normalize_event_coords (data); -- cgit v1.2.3