app: add gimp_display_shell_get_canvas_pickable()
... which is similar to gimp_display_shell_get_pickable(), however,
it returns the projection, rather than the image, only when
gimp_display_shell_get_infinite_canvas() is TRUE, i.e., when the
shell is in "show all" mode *and* canvas padding is disabled.
(cherry picked from commit 71f42f6675
)
This commit is contained in:
@ -1873,6 +1873,26 @@ gimp_display_shell_get_pickable (GimpDisplayShell *shell)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GimpPickable *
|
||||
gimp_display_shell_get_canvas_pickable (GimpDisplayShell *shell)
|
||||
{
|
||||
GimpImage *image;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), NULL);
|
||||
|
||||
image = gimp_display_get_image (shell->display);
|
||||
|
||||
if (image)
|
||||
{
|
||||
if (! gimp_display_shell_get_infinite_canvas (shell))
|
||||
return GIMP_PICKABLE (image);
|
||||
else
|
||||
return GIMP_PICKABLE (gimp_image_get_projection (image));
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GeglRectangle
|
||||
gimp_display_shell_get_bounding_box (GimpDisplayShell *shell)
|
||||
{
|
||||
|
@ -310,6 +310,8 @@ void gimp_display_shell_set_show_all (GimpDisplayShell *shell,
|
||||
gboolean show_all);
|
||||
|
||||
GimpPickable * gimp_display_shell_get_pickable (GimpDisplayShell *shell);
|
||||
GimpPickable * gimp_display_shell_get_canvas_pickable
|
||||
(GimpDisplayShell *shell);
|
||||
GeglRectangle gimp_display_shell_get_bounding_box
|
||||
(GimpDisplayShell *shell);
|
||||
gboolean gimp_display_shell_get_infinite_canvas
|
||||
|
Reference in New Issue
Block a user