diff options
author | Maria <matveeva.maria@gmail.com> | 2014-01-08 18:20:19 +0100 |
---|---|---|
committer | Maria <matveeva.maria@gmail.com> | 2014-01-08 18:20:19 +0100 |
commit | e62f4f920e007d548fade076f2229d2526d47d38 (patch) | |
tree | 3d94cf3b00b4f1d9557bb28c540430e9ef551385 | |
parent | 16c3140d19054c41ba858e87787ff6a688291333 (diff) | |
download | libuca-e62f4f920e007d548fade076f2229d2526d47d38.tar.gz libuca-e62f4f920e007d548fade076f2229d2526d47d38.tar.bz2 libuca-e62f4f920e007d548fade076f2229d2526d47d38.tar.xz libuca-e62f4f920e007d548fade076f2229d2526d47d38.zip |
Fix ROI-rectangle
-rw-r--r-- | bin/gui/control.c | 11 |
1 files changed, 11 insertions, 0 deletions
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); |