Bug 553534 – centering issues after image scaling and setting zoom

to 100%

* app/display/display-enums.h: Added a GimpZoomFocus enum with
'best guess', 'pointer' or 'image center' values.

* app/display/gimpdisplayshell-scale.[ch]
(gimp_display_shell_scale): Take a GimpZoomFocus parameter and
pass it on to

(gimp_display_shell_scale_get_zoom_focus): which returns the
requested zoom focus point if one was given, else makes a best
guess.

* app/actions/view-commands.c
* app/display/gimpstatusbar.c
* app/display/gimpnavigationeditor.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-scale-dialog.c: For explicit-zoom
commands like "zoom to 100%", always use the image center as the
zoom focus point. For all other zooming, continue to use the
best-guess method.

* app/display/display-enums.c: Regenerated.

svn path=/trunk/; revision=27104
This commit is contained in:
Martin Nordholts
2008-10-02 14:53:35 +00:00
parent e94e09f935
commit 259801e34e
10 changed files with 173 additions and 36 deletions

View File

@ -158,6 +158,36 @@ gimp_zoom_quality_get_type (void)
return type;
}
GType
gimp_zoom_focus_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_ZOOM_FOCUS_BEST_GUESS, "GIMP_ZOOM_FOCUS_BEST_GUESS", "best-guess" },
{ GIMP_ZOOM_FOCUS_POINTER, "GIMP_ZOOM_FOCUS_POINTER", "pointer" },
{ GIMP_ZOOM_FOCUS_IMAGE_CENTER, "GIMP_ZOOM_FOCUS_IMAGE_CENTER", "image-center" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_ZOOM_FOCUS_BEST_GUESS, "GIMP_ZOOM_FOCUS_BEST_GUESS", NULL },
{ GIMP_ZOOM_FOCUS_POINTER, "GIMP_ZOOM_FOCUS_POINTER", NULL },
{ GIMP_ZOOM_FOCUS_IMAGE_CENTER, "GIMP_ZOOM_FOCUS_IMAGE_CENTER", NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
{
type = g_enum_register_static ("GimpZoomFocus", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
/* Generated data ends here */