From a513b0d10eeeb6cf63dff5670810d1e56dc4e5a8 Mon Sep 17 00:00:00 2001 From: Seth Burgess Date: Sat, 10 Jul 1999 04:40:51 +0000 Subject: [PATCH] Fixed minor bugs, tweaked behavior if no selection to be consistant. --- ChangeLog | 4 ++++ app/actions/qmask-commands.c | 16 +++++++++++++--- app/actions/quick-mask-commands.c | 16 +++++++++++++--- app/core/gimpimage-qmask.c | 16 +++++++++++++--- app/core/gimpimage-quick-mask.c | 16 +++++++++++++--- app/display/gimpdisplayshell-qmask.c | 16 +++++++++++++--- app/gui/qmask-commands.c | 16 +++++++++++++--- app/qmask.c | 16 +++++++++++++--- 8 files changed, 95 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 55fb69f9a9..bd0b3783e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Jul 9 23:35 CST 1999 Seth Burgess + * app/qmask.c : fixed some small lil' bugs, made no selection not + automatically select all. More features later. + 1999-07-10 Michael Natterer * app/disp_callbacks.c (gdisplay_canvas_events): added wheelmouse diff --git a/app/actions/qmask-commands.c b/app/actions/qmask-commands.c index 157b72b66b..c37876bb45 100644 --- a/app/actions/qmask-commands.c +++ b/app/actions/qmask-commands.c @@ -94,7 +94,9 @@ if (gdisp) gdisp->gimage->qmask_state = 0; gdisplays_flush (); } - + else + gdisp->gimage->qmask_state = 0; + undo_push_group_end (gimg); } } @@ -105,6 +107,7 @@ qmask_activate(GtkWidget *w, { GimpImage *gimg; GimpChannel *gmask; +GimpLayer *layer; unsigned char color[3] = {255,0,0}; double opacity = 50; @@ -122,7 +125,13 @@ if (gdisp) return; /* do nothing if Qmask already exists */ undo_push_group_start (gimg, QMASK_UNDO); if (gimage_mask_is_empty(gimg)) - { /* if no selection */ + { + if ((layer = gimage_floating_sel (gimg))) + { + floating_sel_to_layer (layer); + printf ("111111!!!11!\n"); + } + /* if no selection */ gmask = channel_new(gimg, gimg->width, gimg->height, @@ -130,7 +139,8 @@ if (gdisp) (int)(255*opacity)/100, color); gimp_image_add_channel (gimg, gmask, 0); - edit_clear(gimg,GIMP_DRAWABLE(gmask)); + gimp_drawable_fill (GIMP_DRAWABLE(gmask), 0, 0, 0, 0); + /* edit_clear(gimg,GIMP_DRAWABLE(gmask)); */ undo_push_qmask(gimg,0); gdisp->gimage->qmask_state = 1; gdisplays_flush(); diff --git a/app/actions/quick-mask-commands.c b/app/actions/quick-mask-commands.c index 157b72b66b..c37876bb45 100644 --- a/app/actions/quick-mask-commands.c +++ b/app/actions/quick-mask-commands.c @@ -94,7 +94,9 @@ if (gdisp) gdisp->gimage->qmask_state = 0; gdisplays_flush (); } - + else + gdisp->gimage->qmask_state = 0; + undo_push_group_end (gimg); } } @@ -105,6 +107,7 @@ qmask_activate(GtkWidget *w, { GimpImage *gimg; GimpChannel *gmask; +GimpLayer *layer; unsigned char color[3] = {255,0,0}; double opacity = 50; @@ -122,7 +125,13 @@ if (gdisp) return; /* do nothing if Qmask already exists */ undo_push_group_start (gimg, QMASK_UNDO); if (gimage_mask_is_empty(gimg)) - { /* if no selection */ + { + if ((layer = gimage_floating_sel (gimg))) + { + floating_sel_to_layer (layer); + printf ("111111!!!11!\n"); + } + /* if no selection */ gmask = channel_new(gimg, gimg->width, gimg->height, @@ -130,7 +139,8 @@ if (gdisp) (int)(255*opacity)/100, color); gimp_image_add_channel (gimg, gmask, 0); - edit_clear(gimg,GIMP_DRAWABLE(gmask)); + gimp_drawable_fill (GIMP_DRAWABLE(gmask), 0, 0, 0, 0); + /* edit_clear(gimg,GIMP_DRAWABLE(gmask)); */ undo_push_qmask(gimg,0); gdisp->gimage->qmask_state = 1; gdisplays_flush(); diff --git a/app/core/gimpimage-qmask.c b/app/core/gimpimage-qmask.c index 157b72b66b..c37876bb45 100644 --- a/app/core/gimpimage-qmask.c +++ b/app/core/gimpimage-qmask.c @@ -94,7 +94,9 @@ if (gdisp) gdisp->gimage->qmask_state = 0; gdisplays_flush (); } - + else + gdisp->gimage->qmask_state = 0; + undo_push_group_end (gimg); } } @@ -105,6 +107,7 @@ qmask_activate(GtkWidget *w, { GimpImage *gimg; GimpChannel *gmask; +GimpLayer *layer; unsigned char color[3] = {255,0,0}; double opacity = 50; @@ -122,7 +125,13 @@ if (gdisp) return; /* do nothing if Qmask already exists */ undo_push_group_start (gimg, QMASK_UNDO); if (gimage_mask_is_empty(gimg)) - { /* if no selection */ + { + if ((layer = gimage_floating_sel (gimg))) + { + floating_sel_to_layer (layer); + printf ("111111!!!11!\n"); + } + /* if no selection */ gmask = channel_new(gimg, gimg->width, gimg->height, @@ -130,7 +139,8 @@ if (gdisp) (int)(255*opacity)/100, color); gimp_image_add_channel (gimg, gmask, 0); - edit_clear(gimg,GIMP_DRAWABLE(gmask)); + gimp_drawable_fill (GIMP_DRAWABLE(gmask), 0, 0, 0, 0); + /* edit_clear(gimg,GIMP_DRAWABLE(gmask)); */ undo_push_qmask(gimg,0); gdisp->gimage->qmask_state = 1; gdisplays_flush(); diff --git a/app/core/gimpimage-quick-mask.c b/app/core/gimpimage-quick-mask.c index 157b72b66b..c37876bb45 100644 --- a/app/core/gimpimage-quick-mask.c +++ b/app/core/gimpimage-quick-mask.c @@ -94,7 +94,9 @@ if (gdisp) gdisp->gimage->qmask_state = 0; gdisplays_flush (); } - + else + gdisp->gimage->qmask_state = 0; + undo_push_group_end (gimg); } } @@ -105,6 +107,7 @@ qmask_activate(GtkWidget *w, { GimpImage *gimg; GimpChannel *gmask; +GimpLayer *layer; unsigned char color[3] = {255,0,0}; double opacity = 50; @@ -122,7 +125,13 @@ if (gdisp) return; /* do nothing if Qmask already exists */ undo_push_group_start (gimg, QMASK_UNDO); if (gimage_mask_is_empty(gimg)) - { /* if no selection */ + { + if ((layer = gimage_floating_sel (gimg))) + { + floating_sel_to_layer (layer); + printf ("111111!!!11!\n"); + } + /* if no selection */ gmask = channel_new(gimg, gimg->width, gimg->height, @@ -130,7 +139,8 @@ if (gdisp) (int)(255*opacity)/100, color); gimp_image_add_channel (gimg, gmask, 0); - edit_clear(gimg,GIMP_DRAWABLE(gmask)); + gimp_drawable_fill (GIMP_DRAWABLE(gmask), 0, 0, 0, 0); + /* edit_clear(gimg,GIMP_DRAWABLE(gmask)); */ undo_push_qmask(gimg,0); gdisp->gimage->qmask_state = 1; gdisplays_flush(); diff --git a/app/display/gimpdisplayshell-qmask.c b/app/display/gimpdisplayshell-qmask.c index 157b72b66b..c37876bb45 100644 --- a/app/display/gimpdisplayshell-qmask.c +++ b/app/display/gimpdisplayshell-qmask.c @@ -94,7 +94,9 @@ if (gdisp) gdisp->gimage->qmask_state = 0; gdisplays_flush (); } - + else + gdisp->gimage->qmask_state = 0; + undo_push_group_end (gimg); } } @@ -105,6 +107,7 @@ qmask_activate(GtkWidget *w, { GimpImage *gimg; GimpChannel *gmask; +GimpLayer *layer; unsigned char color[3] = {255,0,0}; double opacity = 50; @@ -122,7 +125,13 @@ if (gdisp) return; /* do nothing if Qmask already exists */ undo_push_group_start (gimg, QMASK_UNDO); if (gimage_mask_is_empty(gimg)) - { /* if no selection */ + { + if ((layer = gimage_floating_sel (gimg))) + { + floating_sel_to_layer (layer); + printf ("111111!!!11!\n"); + } + /* if no selection */ gmask = channel_new(gimg, gimg->width, gimg->height, @@ -130,7 +139,8 @@ if (gdisp) (int)(255*opacity)/100, color); gimp_image_add_channel (gimg, gmask, 0); - edit_clear(gimg,GIMP_DRAWABLE(gmask)); + gimp_drawable_fill (GIMP_DRAWABLE(gmask), 0, 0, 0, 0); + /* edit_clear(gimg,GIMP_DRAWABLE(gmask)); */ undo_push_qmask(gimg,0); gdisp->gimage->qmask_state = 1; gdisplays_flush(); diff --git a/app/gui/qmask-commands.c b/app/gui/qmask-commands.c index 157b72b66b..c37876bb45 100644 --- a/app/gui/qmask-commands.c +++ b/app/gui/qmask-commands.c @@ -94,7 +94,9 @@ if (gdisp) gdisp->gimage->qmask_state = 0; gdisplays_flush (); } - + else + gdisp->gimage->qmask_state = 0; + undo_push_group_end (gimg); } } @@ -105,6 +107,7 @@ qmask_activate(GtkWidget *w, { GimpImage *gimg; GimpChannel *gmask; +GimpLayer *layer; unsigned char color[3] = {255,0,0}; double opacity = 50; @@ -122,7 +125,13 @@ if (gdisp) return; /* do nothing if Qmask already exists */ undo_push_group_start (gimg, QMASK_UNDO); if (gimage_mask_is_empty(gimg)) - { /* if no selection */ + { + if ((layer = gimage_floating_sel (gimg))) + { + floating_sel_to_layer (layer); + printf ("111111!!!11!\n"); + } + /* if no selection */ gmask = channel_new(gimg, gimg->width, gimg->height, @@ -130,7 +139,8 @@ if (gdisp) (int)(255*opacity)/100, color); gimp_image_add_channel (gimg, gmask, 0); - edit_clear(gimg,GIMP_DRAWABLE(gmask)); + gimp_drawable_fill (GIMP_DRAWABLE(gmask), 0, 0, 0, 0); + /* edit_clear(gimg,GIMP_DRAWABLE(gmask)); */ undo_push_qmask(gimg,0); gdisp->gimage->qmask_state = 1; gdisplays_flush(); diff --git a/app/qmask.c b/app/qmask.c index 157b72b66b..c37876bb45 100644 --- a/app/qmask.c +++ b/app/qmask.c @@ -94,7 +94,9 @@ if (gdisp) gdisp->gimage->qmask_state = 0; gdisplays_flush (); } - + else + gdisp->gimage->qmask_state = 0; + undo_push_group_end (gimg); } } @@ -105,6 +107,7 @@ qmask_activate(GtkWidget *w, { GimpImage *gimg; GimpChannel *gmask; +GimpLayer *layer; unsigned char color[3] = {255,0,0}; double opacity = 50; @@ -122,7 +125,13 @@ if (gdisp) return; /* do nothing if Qmask already exists */ undo_push_group_start (gimg, QMASK_UNDO); if (gimage_mask_is_empty(gimg)) - { /* if no selection */ + { + if ((layer = gimage_floating_sel (gimg))) + { + floating_sel_to_layer (layer); + printf ("111111!!!11!\n"); + } + /* if no selection */ gmask = channel_new(gimg, gimg->width, gimg->height, @@ -130,7 +139,8 @@ if (gdisp) (int)(255*opacity)/100, color); gimp_image_add_channel (gimg, gmask, 0); - edit_clear(gimg,GIMP_DRAWABLE(gmask)); + gimp_drawable_fill (GIMP_DRAWABLE(gmask), 0, 0, 0, 0); + /* edit_clear(gimg,GIMP_DRAWABLE(gmask)); */ undo_push_qmask(gimg,0); gdisp->gimage->qmask_state = 1; gdisplays_flush();