Split this up in gimp_display_shell_scale_update_scrollbars() and

2008-08-14  Martin Nordholts  <martinn@svn.gnome.org>

	* app/display/gimpdisplayshell-scale.c
	(gimp_display_shell_update_scrollbars_and_rulers): Split this up
	in gimp_display_shell_scale_update_scrollbars() and
	gimp_display_shell_scale_update_rulers().

svn path=/trunk/; revision=26555
This commit is contained in:
Martin Nordholts
2008-08-14 15:17:40 +00:00
committed by Martin Nordholts
parent 2f52791b2b
commit ecd95dcf76
3 changed files with 113 additions and 71 deletions

View File

@ -1,3 +1,10 @@
2008-08-14 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scale.c
(gimp_display_shell_update_scrollbars_and_rulers): Split this up
in gimp_display_shell_scale_update_scrollbars() and
gimp_display_shell_scale_update_rulers().
2008-08-14 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.c

View File

@ -95,15 +95,27 @@ static gdouble img2real (GimpDisplayShell *shell,
void
gimp_display_shell_update_scrollbars_and_rulers (GimpDisplayShell *shell)
{
GimpImage *image;
gint image_width;
gint image_height;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
if (! shell->display)
return;
gimp_display_shell_scale_update_scrollbars (shell);
gimp_display_shell_scale_update_rulers (shell);
}
/**
* gimp_display_shell_scale_update_scrollbars:
* @shell:
*
**/
void
gimp_display_shell_scale_update_scrollbars (GimpDisplayShell *shell)
{
GimpImage *image;
gint image_width;
gint image_height;
image = shell->display->image;
if (image)
@ -138,10 +150,19 @@ gimp_display_shell_update_scrollbars_and_rulers (GimpDisplayShell *shell)
gimp_display_shell_scroll_setup_vscrollbar (shell, shell->offset_y);
gtk_adjustment_changed (shell->vsbdata);
}
/* Setup rulers */
/**
* gimp_display_shell_scale_update_rulers:
* @shell:
*
**/
void
gimp_display_shell_scale_update_rulers (GimpDisplayShell *shell)
{
GimpImage *image;
gint image_width;
gint image_height;
gdouble horizontal_lower;
gdouble horizontal_upper;
gdouble horizontal_max_size;
@ -151,6 +172,19 @@ gimp_display_shell_update_scrollbars_and_rulers (GimpDisplayShell *shell)
gint scaled_viewport_offset_x;
gint scaled_viewport_offset_y;
image = shell->display->image;
if (image)
{
image_width = gimp_image_get_width (image);
image_height = gimp_image_get_height (image);
}
else
{
image_width = shell->disp_width;
image_height = shell->disp_height;
}
/* Initialize values */
@ -218,7 +252,6 @@ gimp_display_shell_update_scrollbars_and_rulers (GimpDisplayShell *shell)
gimp_ruler_set_unit (GIMP_RULER (shell->vrule),
shell->unit);
}
}
/**
* gimp_display_shell_scale_revert:

View File

@ -21,6 +21,8 @@
void gimp_display_shell_update_scrollbars_and_rulers (GimpDisplayShell *shell);
void gimp_display_shell_scale_update_scrollbars (GimpDisplayShell *shell);
void gimp_display_shell_scale_update_rulers (GimpDisplayShell *shell);
gboolean gimp_display_shell_scale_revert (GimpDisplayShell *shell);
gboolean gimp_display_shell_scale_can_revert (GimpDisplayShell *shell);