mirror of https://github.com/GNOME/gimp.git
mysteriously, using the new tool constructor fixed the crop tool redraw
1999-07-09 Michael Natterer <mitschel@cs.tu-berlin.de> * app/crop.c: mysteriously, using the new tool constructor fixed the crop tool redraw problem. * app/gdisplay.c: clode cleanup * app/info_dialog.c: never emit signals when updating the info fields. Fixes some more transform tool grid redraw bugs.
This commit is contained in:
parent
810a3db516
commit
434915b03d
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
1999-07-09 Michael Natterer <mitschel@cs.tu-berlin.de>
|
||||
|
||||
* app/crop.c: mysteriously, using the new tool constructor fixed
|
||||
the crop tool redraw problem.
|
||||
|
||||
* app/gdisplay.c: clode cleanup
|
||||
|
||||
* app/info_dialog.c: never emit signals when updating the info
|
||||
fields. Fixes some more transform tool grid redraw bugs.
|
||||
|
||||
1999-07-09 Michael Natterer <mitschel@cs.tu-berlin.de>
|
||||
|
||||
* app/commands.c (view_toggle_rulers_cmd_callback): set the
|
||||
|
|
|
@ -289,7 +289,6 @@ gdisplay_format_title (GDisplay *gdisp,
|
|||
static void
|
||||
gdisplay_delete (GDisplay *gdisp)
|
||||
{
|
||||
GDisplay *tool_gdisp;
|
||||
GimpContext *context;
|
||||
|
||||
g_hash_table_remove (display_ht, gdisp->shell);
|
||||
|
@ -299,16 +298,12 @@ gdisplay_delete (GDisplay *gdisp)
|
|||
active_tool_control (HALT, (void *) gdisp);
|
||||
|
||||
/* clear out the pointer to this gdisp from the active tool */
|
||||
if (active_tool && active_tool->gdisp_ptr)
|
||||
{
|
||||
tool_gdisp = active_tool->gdisp_ptr;
|
||||
|
||||
if (gdisp == tool_gdisp)
|
||||
if (active_tool &&
|
||||
active_tool->gdisp_ptr == gdisp)
|
||||
{
|
||||
active_tool->drawable = NULL;
|
||||
active_tool->gdisp_ptr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* free the selection structure */
|
||||
selection_free (gdisp->select);
|
||||
|
@ -337,7 +332,7 @@ gdisplay_delete (GDisplay *gdisp)
|
|||
if (gdisp->window_info_dialog)
|
||||
info_window_free (gdisp->window_info_dialog);
|
||||
|
||||
/* set the active display to NULL */
|
||||
/* set the active display to NULL if it was this display */
|
||||
context = gimp_context_get_user ();
|
||||
if (gimp_context_get_display (context) == gdisp)
|
||||
gimp_context_set_display (context, NULL);
|
||||
|
|
10
app/crop.c
10
app/crop.c
|
@ -742,22 +742,16 @@ tools_new_crop ()
|
|||
tools_register (CROP, (ToolOptions *) crop_options);
|
||||
}
|
||||
|
||||
tool = (Tool *) g_malloc (sizeof (Tool));
|
||||
private = (Crop *) g_malloc (sizeof (Crop));
|
||||
tool = tools_new_tool (CROP);
|
||||
private = g_new (Crop, 1);
|
||||
|
||||
private->core = draw_core_new (crop_draw);
|
||||
private->startx = private->starty = 0;
|
||||
private->function = CREATING;
|
||||
|
||||
tool->type = CROP;
|
||||
tool->state = INACTIVE;
|
||||
tool->scroll_lock = 0; /* Allow scrolling */
|
||||
tool->auto_snap_to = TRUE;
|
||||
tool->private = (void *) private;
|
||||
|
||||
tool->preserve = FALSE; /* XXX Check me */
|
||||
tool->gdisp_ptr = NULL;
|
||||
tool->drawable = NULL;
|
||||
|
||||
tool->button_press_func = crop_button_press;
|
||||
tool->button_release_func = crop_button_release;
|
||||
|
|
|
@ -88,6 +88,10 @@ update_field (InfoField *field)
|
|||
if (field->value_ptr == NULL)
|
||||
return;
|
||||
|
||||
if (field->field_type != INFO_LABEL)
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (field->obj),
|
||||
field->client_data);
|
||||
|
||||
switch (field->field_type)
|
||||
{
|
||||
case INFO_LABEL:
|
||||
|
@ -110,28 +114,19 @@ update_field (InfoField *field)
|
|||
|
||||
case INFO_SIZEENTRY:
|
||||
num = GIMP_SIZE_ENTRY (field->obj)->number_of_fields;
|
||||
|
||||
/* without blocking the first (num - 1) fields, a signal would
|
||||
* be emitted along with every gimp_size_entry_set_refval()...
|
||||
*/
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (field->obj),
|
||||
field->client_data);
|
||||
for (i = 0; i < (num - 1); i++)
|
||||
for (i = 0; i < num; i++)
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (field->obj), i,
|
||||
((gdouble*) field->value_ptr)[i]);
|
||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (field->obj),
|
||||
field->client_data);
|
||||
|
||||
/* ...so block them and emit the signal for the last field only
|
||||
*/
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (field->obj), num - 1,
|
||||
((gdouble*) field->value_ptr)[num - 1]);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_warning (_("Unknown info_dialog field type."));
|
||||
break;
|
||||
}
|
||||
|
||||
if (field->field_type != INFO_LABEL)
|
||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (field->obj),
|
||||
field->client_data);
|
||||
}
|
||||
|
||||
static gint
|
||||
|
|
|
@ -289,7 +289,6 @@ gdisplay_format_title (GDisplay *gdisp,
|
|||
static void
|
||||
gdisplay_delete (GDisplay *gdisp)
|
||||
{
|
||||
GDisplay *tool_gdisp;
|
||||
GimpContext *context;
|
||||
|
||||
g_hash_table_remove (display_ht, gdisp->shell);
|
||||
|
@ -299,16 +298,12 @@ gdisplay_delete (GDisplay *gdisp)
|
|||
active_tool_control (HALT, (void *) gdisp);
|
||||
|
||||
/* clear out the pointer to this gdisp from the active tool */
|
||||
if (active_tool && active_tool->gdisp_ptr)
|
||||
{
|
||||
tool_gdisp = active_tool->gdisp_ptr;
|
||||
|
||||
if (gdisp == tool_gdisp)
|
||||
if (active_tool &&
|
||||
active_tool->gdisp_ptr == gdisp)
|
||||
{
|
||||
active_tool->drawable = NULL;
|
||||
active_tool->gdisp_ptr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* free the selection structure */
|
||||
selection_free (gdisp->select);
|
||||
|
@ -337,7 +332,7 @@ gdisplay_delete (GDisplay *gdisp)
|
|||
if (gdisp->window_info_dialog)
|
||||
info_window_free (gdisp->window_info_dialog);
|
||||
|
||||
/* set the active display to NULL */
|
||||
/* set the active display to NULL if it was this display */
|
||||
context = gimp_context_get_user ();
|
||||
if (gimp_context_get_display (context) == gdisp)
|
||||
gimp_context_set_display (context, NULL);
|
||||
|
|
|
@ -289,7 +289,6 @@ gdisplay_format_title (GDisplay *gdisp,
|
|||
static void
|
||||
gdisplay_delete (GDisplay *gdisp)
|
||||
{
|
||||
GDisplay *tool_gdisp;
|
||||
GimpContext *context;
|
||||
|
||||
g_hash_table_remove (display_ht, gdisp->shell);
|
||||
|
@ -299,16 +298,12 @@ gdisplay_delete (GDisplay *gdisp)
|
|||
active_tool_control (HALT, (void *) gdisp);
|
||||
|
||||
/* clear out the pointer to this gdisp from the active tool */
|
||||
if (active_tool && active_tool->gdisp_ptr)
|
||||
{
|
||||
tool_gdisp = active_tool->gdisp_ptr;
|
||||
|
||||
if (gdisp == tool_gdisp)
|
||||
if (active_tool &&
|
||||
active_tool->gdisp_ptr == gdisp)
|
||||
{
|
||||
active_tool->drawable = NULL;
|
||||
active_tool->gdisp_ptr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* free the selection structure */
|
||||
selection_free (gdisp->select);
|
||||
|
@ -337,7 +332,7 @@ gdisplay_delete (GDisplay *gdisp)
|
|||
if (gdisp->window_info_dialog)
|
||||
info_window_free (gdisp->window_info_dialog);
|
||||
|
||||
/* set the active display to NULL */
|
||||
/* set the active display to NULL if it was this display */
|
||||
context = gimp_context_get_user ();
|
||||
if (gimp_context_get_display (context) == gdisp)
|
||||
gimp_context_set_display (context, NULL);
|
||||
|
|
|
@ -88,6 +88,10 @@ update_field (InfoField *field)
|
|||
if (field->value_ptr == NULL)
|
||||
return;
|
||||
|
||||
if (field->field_type != INFO_LABEL)
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (field->obj),
|
||||
field->client_data);
|
||||
|
||||
switch (field->field_type)
|
||||
{
|
||||
case INFO_LABEL:
|
||||
|
@ -110,28 +114,19 @@ update_field (InfoField *field)
|
|||
|
||||
case INFO_SIZEENTRY:
|
||||
num = GIMP_SIZE_ENTRY (field->obj)->number_of_fields;
|
||||
|
||||
/* without blocking the first (num - 1) fields, a signal would
|
||||
* be emitted along with every gimp_size_entry_set_refval()...
|
||||
*/
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (field->obj),
|
||||
field->client_data);
|
||||
for (i = 0; i < (num - 1); i++)
|
||||
for (i = 0; i < num; i++)
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (field->obj), i,
|
||||
((gdouble*) field->value_ptr)[i]);
|
||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (field->obj),
|
||||
field->client_data);
|
||||
|
||||
/* ...so block them and emit the signal for the last field only
|
||||
*/
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (field->obj), num - 1,
|
||||
((gdouble*) field->value_ptr)[num - 1]);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_warning (_("Unknown info_dialog field type."));
|
||||
break;
|
||||
}
|
||||
|
||||
if (field->field_type != INFO_LABEL)
|
||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (field->obj),
|
||||
field->client_data);
|
||||
}
|
||||
|
||||
static gint
|
||||
|
|
|
@ -88,6 +88,10 @@ update_field (InfoField *field)
|
|||
if (field->value_ptr == NULL)
|
||||
return;
|
||||
|
||||
if (field->field_type != INFO_LABEL)
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (field->obj),
|
||||
field->client_data);
|
||||
|
||||
switch (field->field_type)
|
||||
{
|
||||
case INFO_LABEL:
|
||||
|
@ -110,28 +114,19 @@ update_field (InfoField *field)
|
|||
|
||||
case INFO_SIZEENTRY:
|
||||
num = GIMP_SIZE_ENTRY (field->obj)->number_of_fields;
|
||||
|
||||
/* without blocking the first (num - 1) fields, a signal would
|
||||
* be emitted along with every gimp_size_entry_set_refval()...
|
||||
*/
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (field->obj),
|
||||
field->client_data);
|
||||
for (i = 0; i < (num - 1); i++)
|
||||
for (i = 0; i < num; i++)
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (field->obj), i,
|
||||
((gdouble*) field->value_ptr)[i]);
|
||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (field->obj),
|
||||
field->client_data);
|
||||
|
||||
/* ...so block them and emit the signal for the last field only
|
||||
*/
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (field->obj), num - 1,
|
||||
((gdouble*) field->value_ptr)[num - 1]);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_warning (_("Unknown info_dialog field type."));
|
||||
break;
|
||||
}
|
||||
|
||||
if (field->field_type != INFO_LABEL)
|
||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (field->obj),
|
||||
field->client_data);
|
||||
}
|
||||
|
||||
static gint
|
||||
|
|
|
@ -742,22 +742,16 @@ tools_new_crop ()
|
|||
tools_register (CROP, (ToolOptions *) crop_options);
|
||||
}
|
||||
|
||||
tool = (Tool *) g_malloc (sizeof (Tool));
|
||||
private = (Crop *) g_malloc (sizeof (Crop));
|
||||
tool = tools_new_tool (CROP);
|
||||
private = g_new (Crop, 1);
|
||||
|
||||
private->core = draw_core_new (crop_draw);
|
||||
private->startx = private->starty = 0;
|
||||
private->function = CREATING;
|
||||
|
||||
tool->type = CROP;
|
||||
tool->state = INACTIVE;
|
||||
tool->scroll_lock = 0; /* Allow scrolling */
|
||||
tool->auto_snap_to = TRUE;
|
||||
tool->private = (void *) private;
|
||||
|
||||
tool->preserve = FALSE; /* XXX Check me */
|
||||
tool->gdisp_ptr = NULL;
|
||||
tool->drawable = NULL;
|
||||
|
||||
tool->button_press_func = crop_button_press;
|
||||
tool->button_release_func = crop_button_release;
|
||||
|
|
|
@ -742,22 +742,16 @@ tools_new_crop ()
|
|||
tools_register (CROP, (ToolOptions *) crop_options);
|
||||
}
|
||||
|
||||
tool = (Tool *) g_malloc (sizeof (Tool));
|
||||
private = (Crop *) g_malloc (sizeof (Crop));
|
||||
tool = tools_new_tool (CROP);
|
||||
private = g_new (Crop, 1);
|
||||
|
||||
private->core = draw_core_new (crop_draw);
|
||||
private->startx = private->starty = 0;
|
||||
private->function = CREATING;
|
||||
|
||||
tool->type = CROP;
|
||||
tool->state = INACTIVE;
|
||||
tool->scroll_lock = 0; /* Allow scrolling */
|
||||
tool->auto_snap_to = TRUE;
|
||||
tool->private = (void *) private;
|
||||
|
||||
tool->preserve = FALSE; /* XXX Check me */
|
||||
tool->gdisp_ptr = NULL;
|
||||
tool->drawable = NULL;
|
||||
|
||||
tool->button_press_func = crop_button_press;
|
||||
tool->button_release_func = crop_button_release;
|
||||
|
|
Loading…
Reference in New Issue