diff options
author | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-10-24 19:20:49 +0000 |
---|---|---|
committer | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-10-24 19:20:49 +0000 |
commit | d889de524b665bb82caa232b925044a36054464f (patch) | |
tree | a215ac6ea4c8807eb380877765dbf57469a7c13a /src/imagedisplay.c | |
parent | b538363541f327e9702b4c46162775608e7ed031 (diff) |
Preparation for relrod projection refinement
Add the option to perform a fine centering of patterns
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@174 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/imagedisplay.c')
-rw-r--r-- | src/imagedisplay.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/imagedisplay.c b/src/imagedisplay.c index 2698ac1..26277a2 100644 --- a/src/imagedisplay.c +++ b/src/imagedisplay.c @@ -141,7 +141,8 @@ static void imagedisplay_destroyed(GtkWidget *widget, ImageDisplay *imagedisplay g_object_unref(G_OBJECT(imagedisplay->gc_centre)); g_object_unref(G_OBJECT(imagedisplay->gc_tiltaxis)); - g_object_unref(G_OBJECT(imagedisplay->gc_marks)); + g_object_unref(G_OBJECT(imagedisplay->gc_marks_1)); + g_object_unref(G_OBJECT(imagedisplay->gc_marks_2)); free(imagedisplay); @@ -201,7 +202,16 @@ static gboolean imagedisplay_redraw(GtkWidget *drawingarea, GdkEventExpose *even cur = imagedisplay->marks; while ( cur ) { - gdk_draw_arc(drawingarea->window, imagedisplay->gc_marks, FALSE, + + GdkGC *gc; + + if ( cur->type == IMAGEDISPLAY_MARK_CIRCLE_2 ) { + gc = imagedisplay->gc_marks_2; + } else { + gc = imagedisplay->gc_marks_1; + } + + gdk_draw_arc(drawingarea->window, gc, FALSE, xoffs + cur->x*scale - 5, yoffs + imagedisplay->view_height-1-cur->y*scale - 5, 11, 11, 0, 64*360); @@ -224,9 +234,13 @@ static gint imagedisplay_realize(GtkWidget *widget, ImageDisplay *imagedisplay) gdk_color_parse("#6600dd", &colour); gdk_gc_set_rgb_fg_color(imagedisplay->gc_tiltaxis, &colour); - imagedisplay->gc_marks = gdk_gc_new(imagedisplay->drawingarea->window); + imagedisplay->gc_marks_1 = gdk_gc_new(imagedisplay->drawingarea->window); gdk_color_parse("#dd0000", &colour); - gdk_gc_set_rgb_fg_color(imagedisplay->gc_marks, &colour); + gdk_gc_set_rgb_fg_color(imagedisplay->gc_marks_1, &colour); + + imagedisplay->gc_marks_2 = gdk_gc_new(imagedisplay->drawingarea->window); + gdk_color_parse("#00dd00", &colour); + gdk_gc_set_rgb_fg_color(imagedisplay->gc_marks_2, &colour); imagedisplay->realised = TRUE; @@ -296,13 +310,13 @@ ImageDisplay *imagedisplay_open(ImageRecord image, const char *title, ImageDispl return imagedisplay_open_with_message(image, title, NULL, flags, NULL, NULL); } -void imagedisplay_mark_circle(ImageDisplay *imagedisplay, double x, double y) { +void imagedisplay_add_mark(ImageDisplay *imagedisplay, double x, double y, ImageDisplayMarkType type) { ImageDisplayMark *new; new = malloc(sizeof(ImageDisplayMark)); new->x = x; new->y = y; - new->type = IMAGEDISPLAY_MARK_CIRCLE; + new->type = type; new->next = NULL; if ( !imagedisplay->marks ) { |