From 7a90885404135f0cc57cb8abe3b1f3a05bc90e89 Mon Sep 17 00:00:00 2001 From: Manish Singh Date: Mon, 16 Mar 1998 23:59:27 +0000 Subject: [PATCH] More iscissors fun. Corrected error in HACKING More iscissors fun. Corrected error in HACKING -Yosh --- ChangeLog | 4 ++++ HACKING | 2 +- app/iscissors.c | 26 ++++++++++---------------- app/tools/gimpiscissorstool.c | 26 ++++++++++---------------- app/tools/iscissors.c | 26 ++++++++++---------------- 5 files changed, 35 insertions(+), 49 deletions(-) diff --git a/ChangeLog b/ChangeLog index c89bfe6057..91a7a1cc0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Mar 16 15:57:08 PST 1998 Manish Singh + + * app/iscissors.c: more iscissors fun + Mon Mar 16 17:05:54 CST 1998 Larry Ewing * app/commands.c: changed select_feather_cmd_callback to pass the diff --git a/HACKING b/HACKING index 7fe59dad63..e8a214423b 100644 --- a/HACKING +++ b/HACKING @@ -20,7 +20,7 @@ Basically this does the following for you: cvsroot/gimp# aclocal; automake; autoconf The above commands create the "configure" script. Now you - can run the configure script in cvsroot/gtk+ to create all + can run the configure script in cvsroot/gimp to create all the Makefiles. Before running autogen.sh or configure, make sure you have libtool diff --git a/app/iscissors.c b/app/iscissors.c index a654236798..dfa1fc0e1f 100644 --- a/app/iscissors.c +++ b/app/iscissors.c @@ -545,8 +545,8 @@ iscissors_button_press (Tool *tool, drawable_height(drawable)); iscissors->num_segs = 0; - x = iscissors->x; - y = iscissors->y; + x = bevent->x; + y = bevent->y; add_segment (&(iscissors->num_segs), x, y); @@ -633,7 +633,6 @@ iscissors_button_release (Tool *tool, /* Add one additional segment */ add_segment (&(iscissors->num_segs), segs[0].x1, segs[0].y1); - if (iscissors->num_segs >= 3) { /* Find the boundary */ @@ -672,9 +671,6 @@ iscissors_motion (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; iscissors = (Iscissors *) tool->private; - gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, - &iscissors->x, &iscissors->y, FALSE, TRUE); - switch (iscissors->state) { @@ -761,16 +757,6 @@ iscissors_draw_CR (GDisplay *gdisp, geometry[i][1] = pts[indices[i]].dy * SUPERSAMPLE; break; case SCREEN_COORDS: -/* gdisplay_transform_coords_f (gdisp, , &x, &y, TRUE); - gdisplay_transform_coords (gdisp, points->x, points->y, - &points->sx, &points->sy, 0); - -*/ -/* - gdisplay_untransform_coords_f (gdisp, (int) pts[indices[i]].dx, (int) pts[indices[i]].dy, - &x, &y, TRUE); - -*/ geometry[i][0] = x; geometry[i][1] = y; /*g_print("%f %f\n", x, y);*/ @@ -974,6 +960,7 @@ add_segment (int *num_segs, return 1; } + static int add_point (int *num_pts, int kink, @@ -1247,6 +1234,7 @@ find_edge_xy (TempBuf *edge_buf, static void find_boundary (Tool *tool) { + /* Find directional changes */ shape_of_boundary (tool); @@ -1312,8 +1300,14 @@ shape_of_boundary (Tool *tool) for (i = 0,j=0; i < iscissors->num_kinks; i++) { + /* untransform coords */ + gdisplay_untransform_coords (gdisp, segs[i].x1, segs[i].y1, + &kinks[j].x, &kinks[j].y, FALSE, TRUE); + +/* kinks[j].x = segs[i].x1; kinks[j].y = segs[i].y1; +*/ if(j) { if((kinks[i].x != kinks[j-1].x) || (kinks[j].y != kinks[j-1].y)) diff --git a/app/tools/gimpiscissorstool.c b/app/tools/gimpiscissorstool.c index a654236798..dfa1fc0e1f 100644 --- a/app/tools/gimpiscissorstool.c +++ b/app/tools/gimpiscissorstool.c @@ -545,8 +545,8 @@ iscissors_button_press (Tool *tool, drawable_height(drawable)); iscissors->num_segs = 0; - x = iscissors->x; - y = iscissors->y; + x = bevent->x; + y = bevent->y; add_segment (&(iscissors->num_segs), x, y); @@ -633,7 +633,6 @@ iscissors_button_release (Tool *tool, /* Add one additional segment */ add_segment (&(iscissors->num_segs), segs[0].x1, segs[0].y1); - if (iscissors->num_segs >= 3) { /* Find the boundary */ @@ -672,9 +671,6 @@ iscissors_motion (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; iscissors = (Iscissors *) tool->private; - gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, - &iscissors->x, &iscissors->y, FALSE, TRUE); - switch (iscissors->state) { @@ -761,16 +757,6 @@ iscissors_draw_CR (GDisplay *gdisp, geometry[i][1] = pts[indices[i]].dy * SUPERSAMPLE; break; case SCREEN_COORDS: -/* gdisplay_transform_coords_f (gdisp, , &x, &y, TRUE); - gdisplay_transform_coords (gdisp, points->x, points->y, - &points->sx, &points->sy, 0); - -*/ -/* - gdisplay_untransform_coords_f (gdisp, (int) pts[indices[i]].dx, (int) pts[indices[i]].dy, - &x, &y, TRUE); - -*/ geometry[i][0] = x; geometry[i][1] = y; /*g_print("%f %f\n", x, y);*/ @@ -974,6 +960,7 @@ add_segment (int *num_segs, return 1; } + static int add_point (int *num_pts, int kink, @@ -1247,6 +1234,7 @@ find_edge_xy (TempBuf *edge_buf, static void find_boundary (Tool *tool) { + /* Find directional changes */ shape_of_boundary (tool); @@ -1312,8 +1300,14 @@ shape_of_boundary (Tool *tool) for (i = 0,j=0; i < iscissors->num_kinks; i++) { + /* untransform coords */ + gdisplay_untransform_coords (gdisp, segs[i].x1, segs[i].y1, + &kinks[j].x, &kinks[j].y, FALSE, TRUE); + +/* kinks[j].x = segs[i].x1; kinks[j].y = segs[i].y1; +*/ if(j) { if((kinks[i].x != kinks[j-1].x) || (kinks[j].y != kinks[j-1].y)) diff --git a/app/tools/iscissors.c b/app/tools/iscissors.c index a654236798..dfa1fc0e1f 100644 --- a/app/tools/iscissors.c +++ b/app/tools/iscissors.c @@ -545,8 +545,8 @@ iscissors_button_press (Tool *tool, drawable_height(drawable)); iscissors->num_segs = 0; - x = iscissors->x; - y = iscissors->y; + x = bevent->x; + y = bevent->y; add_segment (&(iscissors->num_segs), x, y); @@ -633,7 +633,6 @@ iscissors_button_release (Tool *tool, /* Add one additional segment */ add_segment (&(iscissors->num_segs), segs[0].x1, segs[0].y1); - if (iscissors->num_segs >= 3) { /* Find the boundary */ @@ -672,9 +671,6 @@ iscissors_motion (Tool *tool, gdisp = (GDisplay *) gdisp_ptr; iscissors = (Iscissors *) tool->private; - gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, - &iscissors->x, &iscissors->y, FALSE, TRUE); - switch (iscissors->state) { @@ -761,16 +757,6 @@ iscissors_draw_CR (GDisplay *gdisp, geometry[i][1] = pts[indices[i]].dy * SUPERSAMPLE; break; case SCREEN_COORDS: -/* gdisplay_transform_coords_f (gdisp, , &x, &y, TRUE); - gdisplay_transform_coords (gdisp, points->x, points->y, - &points->sx, &points->sy, 0); - -*/ -/* - gdisplay_untransform_coords_f (gdisp, (int) pts[indices[i]].dx, (int) pts[indices[i]].dy, - &x, &y, TRUE); - -*/ geometry[i][0] = x; geometry[i][1] = y; /*g_print("%f %f\n", x, y);*/ @@ -974,6 +960,7 @@ add_segment (int *num_segs, return 1; } + static int add_point (int *num_pts, int kink, @@ -1247,6 +1234,7 @@ find_edge_xy (TempBuf *edge_buf, static void find_boundary (Tool *tool) { + /* Find directional changes */ shape_of_boundary (tool); @@ -1312,8 +1300,14 @@ shape_of_boundary (Tool *tool) for (i = 0,j=0; i < iscissors->num_kinks; i++) { + /* untransform coords */ + gdisplay_untransform_coords (gdisp, segs[i].x1, segs[i].y1, + &kinks[j].x, &kinks[j].y, FALSE, TRUE); + +/* kinks[j].x = segs[i].x1; kinks[j].y = segs[i].y1; +*/ if(j) { if((kinks[i].x != kinks[j-1].x) || (kinks[j].y != kinks[j-1].y))