:size-changed-detailed): change double to int in signal parameters.
2008-08-04 Michael Natterer <mitch@gimp.org> * app/core/gimpimage.[ch] (GimpImage::size-changed-detailed): change double to int in signal parameters. Remove gimp_image_emit_size_changed_signals() and call gimp_viewable_size_changed() in size-changed-detailed's default handler. * app/core/gimpimageundo.[ch] * app/core/gimpimage-undo-push.[ch]: change double to int in previous-origin related code. * app/core/gimpimage-undo.c * app/core/gimpimage-scale.c * app/core/gimpimage-crop.c * app/core/gimpimage-rotate.c * app/core/gimpimage-resize.c: call gimp_image_size_changed_detailed() instead of the removed gimp_image_emit_size_changed_signals() * app/display/gimpdisplayshell-scroll.[ch]: remove gimp_display_shell_handle_size_changed_detailed() because it handles both scrolling and scaling and doesn't belong here. * app/display/gimpdisplayshell-handlers.c: moved its code back to gimp_display_shell_size_changed_detailed_handler() and follow the double -> int change above. svn path=/trunk/; revision=26367
This commit is contained in:

committed by
Michael Natterer

parent
21754282ef
commit
26c2c6afda
28
ChangeLog
28
ChangeLog
@ -1,3 +1,31 @@
|
|||||||
|
2008-08-04 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
* app/core/gimpimage.[ch] (GimpImage::size-changed-detailed):
|
||||||
|
change double to int in signal parameters.
|
||||||
|
|
||||||
|
Remove gimp_image_emit_size_changed_signals() and call
|
||||||
|
gimp_viewable_size_changed() in size-changed-detailed's default
|
||||||
|
handler.
|
||||||
|
|
||||||
|
* app/core/gimpimageundo.[ch]
|
||||||
|
* app/core/gimpimage-undo-push.[ch]: change double to int in
|
||||||
|
previous-origin related code.
|
||||||
|
|
||||||
|
* app/core/gimpimage-undo.c
|
||||||
|
* app/core/gimpimage-scale.c
|
||||||
|
* app/core/gimpimage-crop.c
|
||||||
|
* app/core/gimpimage-rotate.c
|
||||||
|
* app/core/gimpimage-resize.c: call gimp_image_size_changed_detailed()
|
||||||
|
instead of the removed gimp_image_emit_size_changed_signals()
|
||||||
|
|
||||||
|
* app/display/gimpdisplayshell-scroll.[ch]: remove
|
||||||
|
gimp_display_shell_handle_size_changed_detailed() because it
|
||||||
|
handles both scrolling and scaling and doesn't belong here.
|
||||||
|
|
||||||
|
* app/display/gimpdisplayshell-handlers.c: moved its code back to
|
||||||
|
gimp_display_shell_size_changed_detailed_handler() and follow the
|
||||||
|
double -> int change above.
|
||||||
|
|
||||||
2008-08-04 Michael Natterer <mitch@gimp.org>
|
2008-08-04 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/core/gimpimagemapconfig.c (gimp_image_map_config_compare):
|
* app/core/gimpimagemapconfig.c (gimp_image_map_config_compare):
|
||||||
|
@ -267,7 +267,7 @@ gimp_image_crop (GimpImage *image,
|
|||||||
gimp_image_get_width (image),
|
gimp_image_get_width (image),
|
||||||
gimp_image_get_height (image));
|
gimp_image_get_height (image));
|
||||||
|
|
||||||
gimp_image_emit_size_changed_signals (image, -x1, -y1);
|
gimp_image_size_changed_detailed (image, -x1, -y1);
|
||||||
|
|
||||||
g_object_thaw_notify (G_OBJECT (image));
|
g_object_thaw_notify (G_OBJECT (image));
|
||||||
}
|
}
|
||||||
|
@ -220,7 +220,7 @@ gimp_image_resize_with_layers (GimpImage *image,
|
|||||||
|
|
||||||
gimp_image_undo_group_end (image);
|
gimp_image_undo_group_end (image);
|
||||||
|
|
||||||
gimp_image_emit_size_changed_signals (image, offset_x, offset_y);
|
gimp_image_size_changed_detailed (image, offset_x, offset_y);
|
||||||
|
|
||||||
g_object_thaw_notify (G_OBJECT (image));
|
g_object_thaw_notify (G_OBJECT (image));
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ gimp_image_rotate (GimpImage *image,
|
|||||||
gimp_image_undo_group_end (image);
|
gimp_image_undo_group_end (image);
|
||||||
|
|
||||||
if (size_changed)
|
if (size_changed)
|
||||||
gimp_image_emit_size_changed_signals (image, -offset_x, -offset_y);
|
gimp_image_size_changed_detailed (image, -offset_x, -offset_y);
|
||||||
|
|
||||||
g_object_thaw_notify (G_OBJECT (image));
|
g_object_thaw_notify (G_OBJECT (image));
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ gimp_image_scale (GimpImage *image,
|
|||||||
|
|
||||||
g_object_unref (sub_progress);
|
g_object_unref (sub_progress);
|
||||||
|
|
||||||
gimp_image_emit_size_changed_signals (image, -offset_x, -offset_y);
|
gimp_image_size_changed_detailed (image, -offset_x, -offset_y);
|
||||||
|
|
||||||
g_object_thaw_notify (G_OBJECT (image));
|
g_object_thaw_notify (G_OBJECT (image));
|
||||||
|
|
||||||
|
@ -81,8 +81,8 @@ gimp_image_undo_push_image_type (GimpImage *image,
|
|||||||
GimpUndo *
|
GimpUndo *
|
||||||
gimp_image_undo_push_image_size (GimpImage *image,
|
gimp_image_undo_push_image_size (GimpImage *image,
|
||||||
const gchar *undo_desc,
|
const gchar *undo_desc,
|
||||||
gdouble previous_origin_x,
|
gint previous_origin_x,
|
||||||
gdouble previous_origin_y)
|
gint previous_origin_y)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||||
|
|
||||||
|
@ -26,8 +26,8 @@ GimpUndo * gimp_image_undo_push_image_type (GimpImage *image,
|
|||||||
const gchar *undo_desc);
|
const gchar *undo_desc);
|
||||||
GimpUndo * gimp_image_undo_push_image_size (GimpImage *image,
|
GimpUndo * gimp_image_undo_push_image_size (GimpImage *image,
|
||||||
const gchar *undo_desc,
|
const gchar *undo_desc,
|
||||||
gdouble previous_origin_x,
|
gint previous_origin_x,
|
||||||
gdouble previous_origin_y);
|
gint previous_origin_y);
|
||||||
GimpUndo * gimp_image_undo_push_image_resolution (GimpImage *image,
|
GimpUndo * gimp_image_undo_push_image_resolution (GimpImage *image,
|
||||||
const gchar *undo_desc);
|
const gchar *undo_desc);
|
||||||
GimpUndo * gimp_image_undo_push_image_grid (GimpImage *image,
|
GimpUndo * gimp_image_undo_push_image_grid (GimpImage *image,
|
||||||
|
@ -381,9 +381,10 @@ gimp_image_undo_pop_stack (GimpImage *image,
|
|||||||
gimp_image_mode_changed (image);
|
gimp_image_mode_changed (image);
|
||||||
|
|
||||||
if (accum.size_changed)
|
if (accum.size_changed)
|
||||||
gimp_image_emit_size_changed_signals (image,
|
gimp_image_size_changed_detailed (image,
|
||||||
accum.previous_origin_x,
|
accum.previous_origin_x,
|
||||||
accum.previous_origin_y);
|
accum.previous_origin_y);
|
||||||
|
|
||||||
if (accum.resolution_changed)
|
if (accum.resolution_changed)
|
||||||
gimp_image_resolution_changed (image);
|
gimp_image_resolution_changed (image);
|
||||||
|
|
||||||
|
@ -148,6 +148,10 @@ static void gimp_image_invalidate_preview (GimpViewable *viewable);
|
|||||||
static void gimp_image_size_changed (GimpViewable *viewable);
|
static void gimp_image_size_changed (GimpViewable *viewable);
|
||||||
static gchar * gimp_image_get_description (GimpViewable *viewable,
|
static gchar * gimp_image_get_description (GimpViewable *viewable,
|
||||||
gchar **tooltip);
|
gchar **tooltip);
|
||||||
|
static void gimp_image_real_size_changed_detailed
|
||||||
|
(GimpImage *image,
|
||||||
|
gint previous_origin_x,
|
||||||
|
gint previous_origin_y);
|
||||||
static void gimp_image_real_colormap_changed (GimpImage *image,
|
static void gimp_image_real_colormap_changed (GimpImage *image,
|
||||||
gint color_index);
|
gint color_index);
|
||||||
static void gimp_image_real_flush (GimpImage *image,
|
static void gimp_image_real_flush (GimpImage *image,
|
||||||
@ -321,10 +325,10 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (GimpImageClass, size_changed_detailed),
|
G_STRUCT_OFFSET (GimpImageClass, size_changed_detailed),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
gimp_marshal_VOID__DOUBLE_DOUBLE,
|
gimp_marshal_VOID__INT_INT,
|
||||||
G_TYPE_NONE, 2,
|
G_TYPE_NONE, 2,
|
||||||
G_TYPE_DOUBLE,
|
G_TYPE_INT,
|
||||||
G_TYPE_DOUBLE);
|
G_TYPE_INT);
|
||||||
|
|
||||||
gimp_image_signals[UNIT_CHANGED] =
|
gimp_image_signals[UNIT_CHANGED] =
|
||||||
g_signal_new ("unit-changed",
|
g_signal_new ("unit-changed",
|
||||||
@ -516,7 +520,11 @@ gimp_image_class_init (GimpImageClass *klass)
|
|||||||
klass->component_visibility_changed = NULL;
|
klass->component_visibility_changed = NULL;
|
||||||
klass->component_active_changed = NULL;
|
klass->component_active_changed = NULL;
|
||||||
klass->mask_changed = NULL;
|
klass->mask_changed = NULL;
|
||||||
klass->size_changed_detailed = NULL;
|
klass->resolution_changed = NULL;
|
||||||
|
klass->size_changed_detailed = gimp_image_real_size_changed_detailed;
|
||||||
|
klass->unit_changed = NULL;
|
||||||
|
klass->quick_mask_changed = NULL;
|
||||||
|
klass->selection_control = NULL;
|
||||||
|
|
||||||
klass->clean = NULL;
|
klass->clean = NULL;
|
||||||
klass->dirty = NULL;
|
klass->dirty = NULL;
|
||||||
@ -1111,6 +1119,14 @@ gimp_image_get_description (GimpViewable *viewable,
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_image_real_size_changed_detailed (GimpImage *image,
|
||||||
|
gint previous_origin_x,
|
||||||
|
gint previous_origin_y)
|
||||||
|
{
|
||||||
|
gimp_viewable_size_changed (GIMP_VIEWABLE (image));
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_image_real_colormap_changed (GimpImage *image,
|
gimp_image_real_colormap_changed (GimpImage *image,
|
||||||
gint color_index)
|
gint color_index)
|
||||||
@ -1483,7 +1499,7 @@ gimp_image_set_resolution (GimpImage *image,
|
|||||||
image->yresolution = yresolution;
|
image->yresolution = yresolution;
|
||||||
|
|
||||||
gimp_image_resolution_changed (image);
|
gimp_image_resolution_changed (image);
|
||||||
gimp_image_emit_size_changed_signals (image, 0.0, 0.0);
|
gimp_image_size_changed_detailed (image, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1816,11 +1832,12 @@ gimp_image_sample_point_removed (GimpImage *image,
|
|||||||
* position of the image in the display shell on various operations,
|
* position of the image in the display shell on various operations,
|
||||||
* e.g. crop.
|
* e.g. crop.
|
||||||
*
|
*
|
||||||
|
* This function makes sure that GimpViewable::size-changed is also emitted.
|
||||||
**/
|
**/
|
||||||
void
|
void
|
||||||
gimp_image_size_changed_detailed (GimpImage *image,
|
gimp_image_size_changed_detailed (GimpImage *image,
|
||||||
gdouble previous_origin_x,
|
gint previous_origin_x,
|
||||||
gdouble previous_origin_y)
|
gint previous_origin_y)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GIMP_IS_IMAGE (image));
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
||||||
|
|
||||||
@ -1857,21 +1874,6 @@ gimp_image_quick_mask_changed (GimpImage *image)
|
|||||||
g_signal_emit (image, gimp_image_signals[QUICK_MASK_CHANGED], 0);
|
g_signal_emit (image, gimp_image_signals[QUICK_MASK_CHANGED], 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
gimp_image_emit_size_changed_signals (GimpImage *image,
|
|
||||||
gdouble previous_origin_x,
|
|
||||||
gdouble previous_origin_y)
|
|
||||||
{
|
|
||||||
/* Emit GimpViewable::size-changed */
|
|
||||||
gimp_viewable_size_changed (GIMP_VIEWABLE (image));
|
|
||||||
|
|
||||||
/* Then emit basically the same signal but with more
|
|
||||||
* details. Clients can choose what signal of these two to listen to
|
|
||||||
* depending on how much info they need.
|
|
||||||
*/
|
|
||||||
gimp_image_size_changed_detailed (image, previous_origin_x, previous_origin_y);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* undo */
|
/* undo */
|
||||||
|
|
||||||
|
@ -191,6 +191,9 @@ struct _GimpImageClass
|
|||||||
GimpChannelType channel);
|
GimpChannelType channel);
|
||||||
void (* mask_changed) (GimpImage *image);
|
void (* mask_changed) (GimpImage *image);
|
||||||
void (* resolution_changed) (GimpImage *image);
|
void (* resolution_changed) (GimpImage *image);
|
||||||
|
void (* size_changed_detailed) (GimpImage *image,
|
||||||
|
gint previous_origin_x,
|
||||||
|
gint previous_origin_y);
|
||||||
void (* unit_changed) (GimpImage *image);
|
void (* unit_changed) (GimpImage *image);
|
||||||
void (* quick_mask_changed) (GimpImage *image);
|
void (* quick_mask_changed) (GimpImage *image);
|
||||||
void (* selection_control) (GimpImage *image,
|
void (* selection_control) (GimpImage *image,
|
||||||
@ -216,9 +219,6 @@ struct _GimpImageClass
|
|||||||
GimpSamplePoint *sample_point);
|
GimpSamplePoint *sample_point);
|
||||||
void (* sample_point_removed) (GimpImage *image,
|
void (* sample_point_removed) (GimpImage *image,
|
||||||
GimpSamplePoint *sample_point);
|
GimpSamplePoint *sample_point);
|
||||||
void (* size_changed_detailed) (GimpImage *image,
|
|
||||||
gdouble previous_origin_x,
|
|
||||||
gdouble previous_origin_y);
|
|
||||||
void (* parasite_attached) (GimpImage *image,
|
void (* parasite_attached) (GimpImage *image,
|
||||||
const gchar *name);
|
const gchar *name);
|
||||||
void (* parasite_detached) (GimpImage *image,
|
void (* parasite_detached) (GimpImage *image,
|
||||||
@ -322,19 +322,14 @@ void gimp_image_sample_point_added (GimpImage *image,
|
|||||||
GimpSamplePoint *sample_point);
|
GimpSamplePoint *sample_point);
|
||||||
void gimp_image_sample_point_removed (GimpImage *image,
|
void gimp_image_sample_point_removed (GimpImage *image,
|
||||||
GimpSamplePoint *sample_point);
|
GimpSamplePoint *sample_point);
|
||||||
void gimp_image_size_changed_detailed (GimpImage *image,
|
|
||||||
gdouble previous_origin_x,
|
|
||||||
gdouble previous_origin_y);
|
|
||||||
void gimp_image_colormap_changed (GimpImage *image,
|
void gimp_image_colormap_changed (GimpImage *image,
|
||||||
gint col);
|
gint col);
|
||||||
void gimp_image_selection_control (GimpImage *image,
|
void gimp_image_selection_control (GimpImage *image,
|
||||||
GimpSelectionControl control);
|
GimpSelectionControl control);
|
||||||
void gimp_image_quick_mask_changed (GimpImage *image);
|
void gimp_image_quick_mask_changed (GimpImage *image);
|
||||||
void gimp_image_emit_size_changed_signals
|
void gimp_image_size_changed_detailed (GimpImage *image,
|
||||||
(GimpImage *image,
|
gint previous_origin_x,
|
||||||
gdouble previous_origin_x,
|
gint previous_origin_y);
|
||||||
gdouble previous_origin_y);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* undo */
|
/* undo */
|
||||||
|
@ -92,18 +92,20 @@ gimp_image_undo_class_init (GimpImageUndoClass *klass)
|
|||||||
undo_class->free = gimp_image_undo_free;
|
undo_class->free = gimp_image_undo_free;
|
||||||
|
|
||||||
g_object_class_install_property (object_class, PROP_PREVIOUS_ORIGIN_X,
|
g_object_class_install_property (object_class, PROP_PREVIOUS_ORIGIN_X,
|
||||||
g_param_spec_double ("previous-origin-x", NULL, NULL,
|
g_param_spec_int ("previous-origin-x",
|
||||||
-G_MAXDOUBLE,
|
NULL, NULL,
|
||||||
G_MAXDOUBLE,
|
-GIMP_MAX_IMAGE_SIZE,
|
||||||
0.0,
|
GIMP_MAX_IMAGE_SIZE,
|
||||||
GIMP_PARAM_READWRITE));
|
0,
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
|
||||||
g_object_class_install_property (object_class, PROP_PREVIOUS_ORIGIN_Y,
|
g_object_class_install_property (object_class, PROP_PREVIOUS_ORIGIN_Y,
|
||||||
g_param_spec_double ("previous-origin-y", NULL, NULL,
|
g_param_spec_int ("previous-origin-y",
|
||||||
-G_MAXDOUBLE,
|
NULL, NULL,
|
||||||
G_MAXDOUBLE,
|
-GIMP_MAX_IMAGE_SIZE,
|
||||||
0.0,
|
GIMP_MAX_IMAGE_SIZE,
|
||||||
GIMP_PARAM_READWRITE));
|
0,
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
|
||||||
g_object_class_install_property (object_class, PROP_GRID,
|
g_object_class_install_property (object_class, PROP_GRID,
|
||||||
g_param_spec_object ("grid", NULL, NULL,
|
g_param_spec_object ("grid", NULL, NULL,
|
||||||
@ -193,10 +195,10 @@ gimp_image_undo_set_property (GObject *object,
|
|||||||
switch (property_id)
|
switch (property_id)
|
||||||
{
|
{
|
||||||
case PROP_PREVIOUS_ORIGIN_X:
|
case PROP_PREVIOUS_ORIGIN_X:
|
||||||
image_undo->previous_origin_x = g_value_get_double (value);
|
image_undo->previous_origin_x = g_value_get_int (value);
|
||||||
break;
|
break;
|
||||||
case PROP_PREVIOUS_ORIGIN_Y:
|
case PROP_PREVIOUS_ORIGIN_Y:
|
||||||
image_undo->previous_origin_y = g_value_get_double (value);
|
image_undo->previous_origin_y = g_value_get_int (value);
|
||||||
break;
|
break;
|
||||||
case PROP_GRID:
|
case PROP_GRID:
|
||||||
{
|
{
|
||||||
@ -227,10 +229,10 @@ gimp_image_undo_get_property (GObject *object,
|
|||||||
switch (property_id)
|
switch (property_id)
|
||||||
{
|
{
|
||||||
case PROP_PREVIOUS_ORIGIN_X:
|
case PROP_PREVIOUS_ORIGIN_X:
|
||||||
g_value_set_double (value, image_undo->previous_origin_x);
|
g_value_set_int (value, image_undo->previous_origin_x);
|
||||||
break;
|
break;
|
||||||
case PROP_PREVIOUS_ORIGIN_Y:
|
case PROP_PREVIOUS_ORIGIN_Y:
|
||||||
g_value_set_double (value, image_undo->previous_origin_y);
|
g_value_set_int (value, image_undo->previous_origin_y);
|
||||||
break;
|
break;
|
||||||
case PROP_GRID:
|
case PROP_GRID:
|
||||||
g_value_set_object (value, image_undo->grid);
|
g_value_set_object (value, image_undo->grid);
|
||||||
@ -293,10 +295,10 @@ gimp_image_undo_pop (GimpUndo *undo,
|
|||||||
|
|
||||||
case GIMP_UNDO_IMAGE_SIZE:
|
case GIMP_UNDO_IMAGE_SIZE:
|
||||||
{
|
{
|
||||||
gint width;
|
gint width;
|
||||||
gint height;
|
gint height;
|
||||||
gdouble previous_origin_x;
|
gint previous_origin_x;
|
||||||
gdouble previous_origin_y;
|
gint previous_origin_y;
|
||||||
|
|
||||||
width = image_undo->width;
|
width = image_undo->width;
|
||||||
height = image_undo->height;
|
height = image_undo->height;
|
||||||
|
@ -40,8 +40,8 @@ struct _GimpImageUndo
|
|||||||
GimpImageBaseType base_type;
|
GimpImageBaseType base_type;
|
||||||
gint width;
|
gint width;
|
||||||
gint height;
|
gint height;
|
||||||
gdouble previous_origin_x;
|
gint previous_origin_x;
|
||||||
gdouble previous_origin_y;
|
gint previous_origin_y;
|
||||||
gdouble xresolution;
|
gdouble xresolution;
|
||||||
gdouble yresolution;
|
gdouble yresolution;
|
||||||
GimpUnit resolution_unit;
|
GimpUnit resolution_unit;
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
#include "libgimpcolor/gimpcolor.h"
|
#include "libgimpcolor/gimpcolor.h"
|
||||||
|
#include "libgimpmath/gimpmath.h"
|
||||||
#include "libgimpwidgets/gimpwidgets.h"
|
#include "libgimpwidgets/gimpwidgets.h"
|
||||||
|
|
||||||
#include "display-types.h"
|
#include "display-types.h"
|
||||||
@ -67,8 +68,8 @@ static void gimp_display_shell_selection_control_handler (GimpImage *i
|
|||||||
GimpDisplayShell *shell);
|
GimpDisplayShell *shell);
|
||||||
static void gimp_display_shell_size_changed_detailed_handler
|
static void gimp_display_shell_size_changed_detailed_handler
|
||||||
(GimpImage *image,
|
(GimpImage *image,
|
||||||
gdouble previous_origin_x,
|
gint previous_origin_x,
|
||||||
gdouble previous_origin_y,
|
gint previous_origin_y,
|
||||||
GimpDisplayShell *shell);
|
GimpDisplayShell *shell);
|
||||||
static void gimp_display_shell_resolution_changed_handler (GimpImage *image,
|
static void gimp_display_shell_resolution_changed_handler (GimpImage *image,
|
||||||
GimpDisplayShell *shell);
|
GimpDisplayShell *shell);
|
||||||
@ -481,13 +482,32 @@ gimp_display_shell_update_sample_point_handler (GimpImage *image,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_display_shell_size_changed_detailed_handler (GimpImage *image,
|
gimp_display_shell_size_changed_detailed_handler (GimpImage *image,
|
||||||
gdouble previous_origin_x,
|
gint previous_origin_x,
|
||||||
gdouble previous_origin_y,
|
gint previous_origin_y,
|
||||||
GimpDisplayShell *shell)
|
GimpDisplayShell *shell)
|
||||||
{
|
{
|
||||||
gimp_display_shell_handle_size_changed_detailed (shell,
|
if (shell->display->config->resize_windows_on_resize)
|
||||||
previous_origin_x,
|
{
|
||||||
previous_origin_y);
|
/* If the window is resized just center the image in it when it
|
||||||
|
* has change size
|
||||||
|
*/
|
||||||
|
gimp_display_shell_shrink_wrap (shell, FALSE);
|
||||||
|
gimp_display_shell_center_image_on_next_size_allocate (shell);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gint scaled_previous_origin_x = SCALEX (shell, previous_origin_x);
|
||||||
|
gint scaled_previous_origin_y = SCALEY (shell, previous_origin_y);
|
||||||
|
|
||||||
|
/* Note that we can't use gimp_display_shell_scroll_private() here
|
||||||
|
* because that would expose the image twice, causing unwanted
|
||||||
|
* flicker.
|
||||||
|
*/
|
||||||
|
gimp_display_shell_scale_by_values (shell, gimp_zoom_model_get_factor (shell->zoom),
|
||||||
|
shell->offset_x + scaled_previous_origin_x,
|
||||||
|
shell->offset_y + scaled_previous_origin_y,
|
||||||
|
FALSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -204,47 +204,6 @@ gimp_display_shell_scroll_clamp_offsets (GimpDisplayShell *shell)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* gimp_display_shell_handle_size_changed_detailed:
|
|
||||||
* @shell:
|
|
||||||
* @previous_origin_x:
|
|
||||||
* @previous_origin_y:
|
|
||||||
*
|
|
||||||
* On e.g. an image crop we want to avoid repositioning the image
|
|
||||||
* content in the display shell if possible.
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
void
|
|
||||||
gimp_display_shell_handle_size_changed_detailed (GimpDisplayShell *shell,
|
|
||||||
gdouble previous_origin_x,
|
|
||||||
gdouble previous_origin_y)
|
|
||||||
{
|
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
|
||||||
|
|
||||||
if (shell->display->config->resize_windows_on_resize)
|
|
||||||
{
|
|
||||||
/* If the window is resized just center the image in it when it
|
|
||||||
* has change size
|
|
||||||
*/
|
|
||||||
gimp_display_shell_shrink_wrap (shell, FALSE);
|
|
||||||
gimp_display_shell_center_image_on_next_size_allocate (shell);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gint scaled_previous_origin_x = SCALEX (shell, previous_origin_x);
|
|
||||||
gint scaled_previous_origin_y = SCALEY (shell, previous_origin_y);
|
|
||||||
|
|
||||||
/* Note that we can't use gimp_display_shell_scroll_private() here
|
|
||||||
* because that would expose the image twice, causing unwanted
|
|
||||||
* flicker.
|
|
||||||
*/
|
|
||||||
gimp_display_shell_scale_by_values (shell, gimp_zoom_model_get_factor (shell->zoom),
|
|
||||||
shell->offset_x + scaled_previous_origin_x,
|
|
||||||
shell->offset_y + scaled_previous_origin_y,
|
|
||||||
FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_display_shell_get_scaled_viewport:
|
* gimp_display_shell_get_scaled_viewport:
|
||||||
* @shell:
|
* @shell:
|
||||||
|
@ -26,10 +26,6 @@ void gimp_display_shell_center_around_image_coordinate (GimpDisplayShell
|
|||||||
|
|
||||||
void gimp_display_shell_scroll_clamp_offsets (GimpDisplayShell *shell);
|
void gimp_display_shell_scroll_clamp_offsets (GimpDisplayShell *shell);
|
||||||
|
|
||||||
void gimp_display_shell_handle_size_changed_detailed (GimpDisplayShell *shell,
|
|
||||||
gdouble previous_origin_x,
|
|
||||||
gdouble previous_origin_y);
|
|
||||||
|
|
||||||
void gimp_display_shell_get_scaled_viewport (const GimpDisplayShell *shell,
|
void gimp_display_shell_get_scaled_viewport (const GimpDisplayShell *shell,
|
||||||
gint *x,
|
gint *x,
|
||||||
gint *y,
|
gint *y,
|
||||||
|
Reference in New Issue
Block a user